📄 dvpstat.h
字号:
unsigned long maxHeight, OFBool clipMode = OFFalse); /** deletes and disables the current preview image. */ void deletePreviewImage(); /** gets number of bytes used for the preview image bitmap. * (depends on width and height) * @return number of bytes used for the preview image bitmap */ unsigned long getPreviewImageSize(); /** gets current width and height of the preview image. * @param width upon success, the image width (in pixels) is returned in this parameter * @param height upon success, the image height (in pixels) is returned in this parameter * @return EC_Normal upon success, an error code otherwise */ OFCondition getPreviewImageWidthHeight(unsigned long &width, unsigned long &height); /** gets current width of the preview image. * @param width upon success, the image width (in pixels) is returned in this parameter * @return EC_Normal upon success, an error code otherwise */ OFCondition getPreviewImageWidth(unsigned long &width); /** gets current height of the preview image. * @param height upon success, the image height (in pixels) is returned in this parameter * @return EC_Normal upon success, an error code otherwise */ OFCondition getPreviewImageHeight(unsigned long &height); /** writes the bitmap data of the preview image into the given buffer. * 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 (array of 8 bit values) * @param size specifies size of the storage area in bytes * @return EC_Normal upon success, an error code otherwise */ OFCondition getPreviewImageBitmap(void *bitmap, unsigned long size); /** gets smallest and biggest possible pixel value in the attached image. * These values are defined as the smallest and biggest number that * could possibly be contained in the image after application of the Modality transform, * but before any VOI, Presentation or display transform. * This method may only be called when an image is attached to the * presentation state. * @param minValue upon success, the smallest value is returned in this parameter. * @param maxValue upon success, the biggest value is returned in this parameter. * @return EC_Normal upon success, an error code otherwise */ OFCondition getImageMinMaxPixelRange(double &minValue, double& maxValue); /** gets smallest and biggest occuring pixel value in the attached image. * These values are defined as the smallest and biggest number that * are actually contained in the image after application of the Modality transform, * but before any VOI, Presentation or display transform. * This method may only be called when an image is attached to the * presentation state. * @param minValue upon success, the smallest value is returned in this parameter. * @param maxValue upon success, the biggest value is returned in this parameter. * @return EC_Normal upon success, an error code otherwise */ OFCondition getImageMinMaxPixelValue(double &minValue, double& maxValue); /** gets the number of frames of the current (attached) image. * This method may only be called when an image is attached to the * presentation state. * @param frames upon success, the number of frames is returned in this parameter. * @return EC_Normal upon success, an error code otherwise */ OFCondition getImageNumberOfFrames(unsigned long &frames); /** selects one frame of a multiframe image. This affects the image bitmap * that is rendered, the overlay bitmaps and the visibility of graphic and text objects. * This method may only be called when an image is attached to the * presentation state. * @param frame frame number in the range [1..getImageNumberOfFrames()] * @return EC_Normal upon success, an error code otherwise */ OFCondition selectImageFrameNumber(unsigned long frame); /** gets the index of the currently selected frame in a multi-frame image. * @return index of the currently selected frame, 0 if an error occurred */ unsigned long getSelectedImageFrameNumber(); /** gets the currently selected display transform. * Display transform will only be performed if switched on _and_ * a valid monitor characteristics description exists. * Default after creation of a presentation state is "on". * @return current display transform if on, DVPSD_none if off. */ DVPSDisplayTransform getDisplayTransform() { return displayTransform; } /** activates or deactivates display correction. * Display transform will only be performed if switched on * _and_ a valid display function object exists. * @param transform display transform to be set, DVPSD_none to switch off. */ void setDisplayTransform(DVPSDisplayTransform transform) { displayTransform = transform; } /** converts a 16-bit P-Value to an 8-bit DDL value for on-sceen display. * If a display function is set and enabled (see setDisplayTransform()), * the DDL is corrected for the nonlinearity of the display, otherwise * a simple linear mapping is performed. For 12-bit DDL values (hardcopy) * the display function is automatically disabled. * @param pvalue P-Value 0..0xFFFF * @param bits number of bits used for the output DDL value (8 = softcopy, 12 = hardcopy) * @return display driving level (DDL), 0..0xFF (8 bit) / 0..0xFFF (12 bit) */ Uint16 convertPValueToDDL(Uint16 pvalue, unsigned int bits = 8); /** writes the patient module attributes and a source image sequence * for a grayscale hardcopy image. * Copies of the DICOM elements managed by this object are inserted into * the DICOM dataset. * @param dset the dataset to which the data is written * @return EC_Normal if successful, an error code otherwise. */ OFCondition writeHardcopyImageAttributes(DcmItem &dset); /** gets the modality of the attached image. * @return modality string if it exists, NULL or empty string otherwise. */ const char *getCurrentImageModality(); /** tries to find an overlay repeating group that is not used in the * presentation state or the attached image. If that does not exist, * it returns a group number that is unused in the presentation state * but used in the image. * @param currentGroup the current group number of the overlay * to be changed (if any) * @return group number 0x6000..0x601F if found, 0 otherwise. */ Uint16 findOverlayGroup(Uint16 currentGroup=0); /** prepares pixel data for image and overlays for access. * This method is called internally before any image pixel data * or overlay bitmaps is created. It makes sure that the following settings * of the presentation state are reflected in the dcmimage-based * image processing routines: VOI transformation, Presentation LUT, * rotation, flip, overlay activation. * @param display use current display function if OFTrue, don't use otherwise */ void renderPixelData(OFBool display = OFTrue); /** attempts to find the displayed area selection for the * current image and frame. If not found, creates a default. * @return displayed area selection item. If creation of a default failed * or no image is attached to the presentation state, returns NULL. */ DVPSDisplayedArea *getDisplayedAreaSelection(); /** attempts to find the Softcopy VOI LUT item for the * current image and frame. If not found, returns NULL. * @return softcopy VOI LUT item for current image and frame if found, NULL otherwise */ DVPSSoftcopyVOI *getCurrentSoftcopyVOI(); /** sets a new log stream * @param stream new log stream, NULL for default logstream * @param verbMode verbose mode flag * @param dbgMode debug mode flag */ void setLog(OFConsole *stream, OFBool verbMode, OFBool dbgMode);private: /** helper method that activates the given overlay in the given image * @param ovl overlay to activate * @param image image to be rendered * @param asShutter true if overlay should be used as bitmap shutter * @param pvalue pvalue for overlay foreground * @return EC_Normal if successful, an error code otherwise */ static OFCondition activateOverlayHelper( DVPSOverlay& ovl, DicomImage &image, OFBool asShutter = OFFalse, Uint16 pvalue = 0); /* connection with dcmimage */ /** a pointer to the DICOM dataset comprising the image * to which the presentation state is currently applied */ DcmDataset *currentImageDataset; /** a pointer to the fileformat (if it exists) of the * DICOM dataset comprising the image to which the * presentation state is currently applied */ DcmFileFormat *currentImageFileformat; /** a pointer to the dcmimage representation of the * image to which the presentation state is currently applied */ DicomImage *currentImage; /** a pointer to the dcmimage representation of the (smaller) preview * image to which the presentation state is currently applied */ DicomImage *previewImage; /** contains the width of the attached image without consideration of rotation. */ unsigned long currentImageWidth; /** contains the height of the attached image without consideration of rotation. */ unsigned long currentImageHeight; /** contains the width of the attached image after pixel data have been rendered (w/o clipping). */ unsigned long renderedImageWidth; /** contains the height of the attached image after pixel data have been rendered (w/o clipping). */ unsigned long renderedImageHeight; /** contains the top hand corner of the attached image after pixel data have been rendered. */ signed long renderedImageTop; /** contains the left hand corner of the attached image after pixel data have been rendered. * (the following equation is always true: renderedImageTop <= renderedImageBottom) */ signed long renderedImageLeft; /** contains the bottom hand corner of the attached image after pixel data have been rendered. * (the following equation is always true: renderedImageLeft <= renderedImageRight) */ signed long renderedImageBottom; /** contains the right hand corner of the attached image after pixel data have been rendered. */ signed long renderedImageRight; /** contains the SOP Class UID of the attached image */ char *currentImageSOPClassUID; /** contains the SOP Instance UID of the attached image */ char *currentImageSOPInstanceUID; /** contains the current selected frame number of the attached image. * Frame numbers are counted from 1 (like in DICOM, unlike dcmimgle). */ unsigned long currentImageSelectedFrame; /** a flag describing whether the presentation state is owner of * the DICOM dataset in currentImageDataset/currentImageFileformat. * If the presentation state is owner, it will delete the dataset * upon its own destruction or attachment of a different image. */ OFBool currentImageOwned; /** a flag describing whether the VOI settings in currentImage * match the ones in the presentation state. */ OFBool currentImageVOIValid; /** a flag describing whether the presentation LUT settings * in currentImage match the ones in the presentation state. */ OFBool currentImageP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -