⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dvpstat.h

📁 转化为DIB位图再显示出来的dicom文件C++代码
💻 H
📖 第 1 页 / 共 5 页
字号:
   /** checks if an overlay from the presentation state is suitable    *  for use as a bitmap shutter. An overlay is suitable if it is a graphic overlay    *  with the same size as the attached image and with the origin 1\1.    *  This method does not check wether the overlay is already activated as overlay    *  or bitmap shutter.    *  @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState().    *  @return OFTrue if overlay can be used as display shutter.    */   OFBool overlayIsSuitableAsBitmapShutter(size_t idx);    /** activates the given overlay from the attached image    *  on the given graphic layer.    *  If the overlay is already activated (i.e.    *  getOverlayInImageActivationLayer(idx) != DVPS_IDX_NONE) this method fails.    *  @param layer index of the graphic layer, must be < getNumberOfGraphicLayers()    *  @param idx index of the overlay, must be < getNumberOfOverlaysInImage().    *  @return EC_Normal upon success, an error code otherwise.    */   OFCondition activateOverlayInImage(size_t layer, size_t idx);    /** activates the given overlay from the presentation state    *  on the given graphic layer.    *  If the overlay is already activated or used as a bitmap overlay (i.e.    *  getOverlayInPresentationStateActivationLayer(idx) != DVPS_IDX_NONE or    *  overlayIsBitmapShutter(idx) == OFTrue) this method fails.    *  @param layer index of the graphic layer, must be < getNumberOfGraphicLayers()    *  @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState().    *  @return EC_Normal upon success, an error code otherwise.    */   OFCondition activateOverlayInPresentationState(size_t layer, size_t idx);    /** activates an overlay as bitmap shutter.    *  The overlay must not be activated on a graphic layer (i.e.    *  getOverlayInPresentationStateActivationLayer(idx) != DVPS_IDX_NONE,    *  otherwise this method fails.    *  @param idx index of the overlay, must be < getNumberOfOverlaysInPresentationState().    *  @return EC_Normal upon success, an error code otherwise.    */   OFCondition activateOverlayAsBitmapShutter(size_t idx);    /** removes activation for an overlay which may be    *  embedded in the attached image or part of the presentation state.    *  @param layer index of the graphic layer on which this overlay is    *    activated, must be < getNumberOfGraphicLayers().    *  @param idx index of the overlay activation on the given layer,    *    must be < getNumberOfActiveOverlays(layer).    *  @return EC_Normal upon success, an error code otherwise.    */   OFCondition deactivateOverlay(size_t layer, size_t idx);    /** attaches an image to the presentation state.    *  If an image is already attached to the presentation state,    *  the old image is detached (and freed if necessary) and the new image is attached.    *  A preview image is created automatically (if values for preview resolution are valid).    *  @param dataset pointer to the DICOM image as DcmDataset.    *  @param transferOwnership if true, the presentation state assumes ownership    *    of the passed DcmDataset, which is freed when a different image is attached    *    or the presentation state is deleted.    *  @return EC_Normal if successful, an error code otherwise. If an error code    *    is returned, the presentation state has the same state as before the call    *    to this method.    */   OFCondition attachImage(DcmDataset *dataset, OFBool transferOwnership);    /** attaches an image to the presentation state.    *  If an image is already attached to the presentation state,    *  the old image is detached (and freed if necessary) and the new image is attached.    *  A preview image is created automatically (if values for preview resolution are valid).    *  @param fileformat pointer to the DICOM image as DcmFileFormat.    *  @param transferOwnership if true, the presentation state assumes ownership    *    of the passed DcmFileFormat, which is freed when a different image is attached    *    or the presentation state is deleted.    *  @return EC_Normal if successful, an error code otherwise. If an error code    *    is returned, the presentation state has the same state as before the call    *    to this method.    */   OFCondition attachImage(DcmFileFormat *fileformat, OFBool transferOwnership);    /** detaches and frees the image (incl. preview) attached to the presentation state.    */   void detachImage();    /** checks whether image is inverse (shape, plut or mono1).    *  @return OFTrue if image is inverse, OFFalse otherwise.    */   OFBool isInverse();    /** inverts image by changing presentation state LUT or presentation state LUT shape.    *  Pixel data has to be re-get after this transformation.    *  @return EC_Normal upon success, an error code otherwise.    */   OFCondition invertImage();    /** applies presentation state to attached image and returns image bitmap.    *  This method sets all parameter required to correctly render the pixel data    *  in the image attached to the presentation state and then creates the    *  required pixel data which contains all grayscale transformations but none    *  of the none-grayscale transformations of the presentation state "burned in"    *  into the pixel data. The pixel data returned is already corrected by a    *  display transform for the current display device and can be mapped directly    *  to digital driving levels of the graphics board. The pointer to the pixel    *  data remains valid until the next call to this function, or until the    *  image is detached or the presentation state is deleted.    *  @param pixelData in this parameter a pointer to the pixel data is returned    *    (array of 8 bit values). The storage area allocated for this pointer must    *    not be freed by the caller. If the return value is an error code,    *    no valid pixel data pointer may be assumed.    *  @param width returns the width of the bitmap in pixels    *  @param height returns the height of the bitmap in pixels    *  @return EC_Normal upon success, an error code otherwise.    */    OFCondition getPixelData(      const void *&pixelData,      unsigned long &width,      unsigned long &height);    /** same as method above apart from the fact that the storage area is handled    *  externally.    *  @param pixelData pointer to storage area where the pixel data is copied to    *    (array of 8 bit values). The storage area must be allocated and deleted    *    from the calling method.    *  @param size specifies size of the storage area in bytes.    *  @return EC_Normal upon success, an error code otherwise.    */    OFCondition getPixelData(      void *pixelData,      unsigned long size);     /** returns the SOP Class UID of the currently attached image.     *  @return SOP class UID of current image, NULL if absent     */    const char *getAttachedImageSOPClassUID();     /** returns the SOP Instance UID of the currently attached image.     *  @return SOP instance UID of current image, NULL if absent     */    const char *getAttachedImageSOPInstanceUID();     /** gets the width of the attached image.     *  The rotation status of the presentation state is not taken     *  into account, i.e. the width of an unrotated image is returned.     *  This method may only be called when an image is attached to the     *  presentation state.     *  @param width upon success, the image width (pixels) is returned in this parameter.     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition getImageWidth(unsigned long &width);     /** gets the height of the attached image.     *  The rotation status of the presentation state is not taken     *  into account, i.e. the height of an unrotated image is returned.     *  This method may only be called when an image is attached to the     *  presentation state.     *  @param height upon success, the image height (pixels) is returned in this parameter.     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition getImageHeight(unsigned long &height);     /** gets number of bytes used for the print bitmap.     *  (depends on width, height and depth)     *  @return number of bytes used for the print bitmap     */    unsigned long getPrintBitmapSize();     /** sets the minimum print bitmap width and height.     *  Smaller images are scaled up by an appropriate integer factor. Both maximum     *  values need to be twice greater than the maximum of the minimum values.     *  @param width minimum width of print bitmap (in pixels)     *  @param height minimum height of print bitmap (in pixels)     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition setMinimumPrintBitmapWidthHeight(unsigned long width,                                                 unsigned long height);     /** sets the maximum print bitmap width and height.     *  Larger images are scaled down by an appropriate integer factor. Both maximum     *  values need to be twice greater than the maximum of the minimum values.     *  @param width maximum width of print bitmap (in pixels)     *  @param height maximum height of print bitmap (in pixels)     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition setMaximumPrintBitmapWidthHeight(unsigned long width,                                                 unsigned long height);     /** gets width and height of print bitmap.     *  Bitmap size depends on implicit scaling, a heuristic is used for very small images.     *  The return values depend on the current minimum/maximum print bitmap width/height values!     *  @param width upon success, the bitmap width (in pixels) is returned in this parameter     *  @param height upon success, the bitmap height (in pixels) is returned in this parameter     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition getPrintBitmapWidthHeight(unsigned long &width,                                          unsigned long &height);     /** gets width of print bitmap.     *  Bitmap size depends on implicit scaling, a heuristic is used for very small images.     *  The return value depends on the current minimum/maximum print bitmaps width/height values!     *  @param width upon success, the image width (in pixels) is returned in this parameter     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition getPrintBitmapWidth(unsigned long &width);     /** gets height of print bitmap.     *  bitmap size depends on implicit scaling, a heuristic is used for very small images     *  The return value depends on the current minimum/maximum print bitmaps width/height values!     *  @param height upon success, the image height (in pixels) is returned in this parameter     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition getPrintBitmapHeight(unsigned long &height);     /** gets the presentation pixel aspect ratio for the print bitmap.     *  Pixel aspect ratio is defined here as the width of a pixel divided     *  by the height of a pixel (x/y). The related image is already rotated and flipped!     *  @return pixel aspect ratio     */    double getPrintBitmapPixelAspectRatio();     /** gets requested image size for print bitmap.     *  If the presentation state mode is DVPSD_trueSize, this method computes     *  the true physical width (in mm) of the print image (under consideration of the     *  rotation status) and writes it to the requestedImageSize string.     *  @param requestedImageSize requested image size is written to this parameter upon     *    successful return. Otherwise string is empty upon return.     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition getPrintBitmapRequestedImageSize(OFString& requestedImageSize);     /** writes the bitmap data into the given buffer.     *  The bitmap has the format: 12 bits stored and 16 bits allocated. This method is used     *  to create the preformatted bitmap where the annotations are later burned in.     *  Implicit scaling is performed if the bitmap is too small (see minimum bitmap size).     *  The storage area must be allocated and deleted from the calling method.     *  @param bitmap pointer to storage area where the pixel data is copied to.     *  @param size specifies size of the storage area in bytes     *  @param inversePLUT render inverse PLUT into bitmap if OFTrue (optional)     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition getPrintBitmap(void *bitmap,                               unsigned long size,                               OFBool inversePLUT = OFFalse);     /** creates a new preview image based on the current image and pstate.     *  The maximum size of this image is specified by the two parameters maxWidth and maxHeight.     *  The actual size should be determined using one of the following appropriate methods (e.g.     *  getPreviewImageWidthHeight) since the original pixel aspect ratio is alsways considered.     *  The preview image includes all grayscale and spatial transformations performed on the     *  current image so far. The method renderPixelData also renders the preview image (if existing).     *  Therefore the preview image is always held consistent with the current image.     *  Overlays, bitmapped shutters and any other annotations are not rendered into the preview image.     *  @param width the maximum width used to create the preview image     *  @param height the maximum height used to create the preview image     *  @param clipMode specifies whether to clip the preview image to the displayed area (not implemented!)     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition createPreviewImage(unsigned long maxWidth,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -