📄 dimoimg.h
字号:
* @param explanation variable in which the result text is stored * ** @return pointer to description text (NULL if absent or index invalid) */ const char *getVoiLutExplanation(const unsigned long pos, OFString &explanation) const; /** get description of performed modality LUT transformation * ** @return pointer to description text (NULL if absent) */ inline const char *getModalityLutExplanation() const { return (InterData != NULL) ? InterData->getModalityLutExplanation() : OFstatic_cast(const char *, NULL); } /** set hardcopy parameters. (used to display LinOD images) * ** @param min minimum density of the print-out (in hundreds of Optical Density, e.g. 150 means 1.5 OD) * @param max maximum density of the print-out (ditto) * @param reflect reflected ambient light (in candela per square meter - cd/m^2) * @param illumin illumination (ditto) * ** @return true if successful (1 = at least one of the parameters has changed, * 2 = no parameter has changed) * false otherwise */ int setHardcopyParameters(const unsigned int min, const unsigned int max, const unsigned int reflect, const unsigned int illumin); /** get shape for presentation transformation. * possible values are: ESP_Default, ESP_Identity, ESP_Inverse, ESP_LinOD * If a presentation LUT is currently active ESP_Default is always returned. * ** @return currently active presentation LUT shape */ ES_PresentationLut getPresentationLutShape() const; /** set shape for presentation transformation. * possibly active presentation LUT is implicitly disabled. * ** @param shape presentation LUT shape (default, identity or inverse). * 'default' means that the output data is always created with 0 for black * and maxvalue for white (i.e. monochrome2 data is created for output). * ** @return true if successful (1 = shape has changed, * 2 = shape has not changed) * false otherwise */ int setPresentationLutShape(const ES_PresentationLut shape); /** set LUT for presentation transformation. * possibly active presentation LUT is implicitly disabled. * ** @param data contains LUT data * @param descriptor describes LUT structure * @param explanation free form description of presentation LUT (optional) * @param ignoreDepth ignore third value of LUT descriptor if OFTrue. * Determine bits per table entry automatically from max value. * ** @return true if successful, false otherwise */ int setPresentationLut(const DcmUnsignedShort &data, const DcmUnsignedShort &descriptor, const DcmLongString *explanation = NULL, const OFBool ignoreDepth = OFFalse); /** set inverse LUT for presentation transformation. * this LUT transform is e.g. used for DICOM print (12->8, 8->12 bit) * possibly active presentation LUT will not be considered ! * ** @param data contains LUT data * @param descriptor describes LUT structure * @param ignoreDepth ignore third value of LUT descriptor if OFTrue. * Determine bits per table entry automatically from max value. * ** @return true if successful, false otherwise */ int setInversePresentationLut(const DcmUnsignedShort &data, const DcmUnsignedShort &descriptor, const OFBool ignoreDepth = OFFalse); /** get description of active presentation LUT * ** @return pointer to description text (NULL if absent) */ inline const char *getPresentationLutExplanation() const { return (PresLutData != NULL) ? PresLutData->getExplanation() : OFstatic_cast(const char *, NULL); } /** add specified plane to group of additional overlay planes. * replaces old overlay plane if group number already exists. * ** @param group group number (0x60nn) of overlay plane * @param left_pos x coordinate of plane orgin (referring to image origin) * @param top_pos y coordinate of plane origin * @param columns width of overlay plane (in pixels) * @param rows height of overlay plane (in pixels) * @param data overlay plane data (dcmdata element) * @param label overlay plane label * @param description overlay plane description * @param mode display mode (see 'diutils.h') * ** @return false (0) if an error occurred, true otherwise (1 = added new plane, * 2 = replaced existing plane) */ int addOverlay(const unsigned int group, const signed int left_pos, const signed int top_pos, const unsigned int columns, const unsigned int rows, const DcmOverlayData &data, const DcmLongString &label, const DcmLongString &description, const EM_Overlay mode); /** remove all additional overlay planes * ** @return false (0) if an error occurred, true otherwise */ int removeAllOverlays(); /** get pointer to specified overlay managing object * ** @param idx index of overlay group (0 = dataset, 1 = additional) * ** @return pointer to overlay managing object (NULL if absent or invalid) */ inline DiOverlay *getOverlayPtr(const unsigned int idx) { return (idx < 2) ? Overlays[idx] : OFstatic_cast(DiOverlay *, NULL); } /** get pointer to current monochrome image (this) * ** @return pointer to this object */ inline DiMonoImage *getMonoImagePtr() { return this; } /** flip current image (horizontally and/or vertically) * ** @param horz flip horizontally if true * @param vert flip vertically if true * ** @return true if successful (1 = flipped at least direction, * 2 = not flipped, because of image resolution - width and/or height equal to 1), * false otherwise */ int flip(const int horz, const int vert); /** rotate current image (by steps of 90 degrees) * ** @param degree angle by which the image shall be rotated (-360, -270, -180, -90, 0, 90, 180, 270, 360) * ** @return true if successful (1 = rotated by at least 90 degrees, * 2 = not rotated, because of image resolution or angle), * false otherwise */ int rotate(const int degree); /** get number of bits per sample. * If the optional parameter is specified the value will be checked and in any case * a valid value will be returned. * ** @param bits value to be returned (if less than 1 or greater than the maximum (32) * the default value will be used which is equal to the bits per sample * value stored in the DICOM dataset) * ** @return status, true if successful, false otherwise */ virtual int getBits(const int bits = 0) const { return (((bits < 1) || (bits > MAX_BITS)) && (bits != MI_PastelColor)) ? BitsPerSample : bits; } /** get number of bytes required for the rendered output of a single frame * * @param bits number of bits for the output pixel data (depth) * ** @return number of bytes if successful, 0 otherwise */ virtual unsigned long getOutputDataSize(const int bits = 0) const; /** get pixel data with specified format. * (memory is handled internally) * ** @param frame number of frame to be rendered * @param bits number of bits for the output pixel data (depth) * @param planar flag, only useful for multi-planar images (color) * ** @return untyped pointer to the pixel data if successful, NULL otherwise */ virtual const void *getOutputData(const unsigned long frame, const int bits, const int planar = 0) = 0; /** get pixel data with specified format. * (memory is handled externally) * ** @param buffer untyped pointer to the externally allocated memory buffer * @param size size of the memory buffer in bytes (will be checked) * @param frame number of frame to be rendered * @param bits number of bits for the output pixel data (depth) * @param planar flag, only useful for multi-planar images (color) * ** @return status, true if successful, false otherwise */ virtual int getOutputData(void *buffer, const unsigned long size, const unsigned long frame, const int bits, const int planar = 0) = 0; /** get pixel data of specified plane. * (memory is handled internally) * ** @param dummy (not used) * ** @return untyped pointer to the pixel data if successful, NULL otherwise */ const void *getOutputPlane(const int dummy) const; /** delete internally handled output memory buffer * Save memory if data is no longer needed. */ void deleteOutputData(); /** create bitmap for specified overlay plane. * (up to 16 bits per pixel with two values: fore and back) * ** @param frame index of frame used for output * @param plane number (0..15) or group number (0x60nn) of overlay plane * @param left_pos returns x coordinate of plane's origin * @param top_pos returns y coordinate of plane's origin * @param width returns width of overlay plane (in pixels) * @param height returns height of overlay plane (in pixels) * @param mode return display mode (see 'diutils.h') * @param idx index of overlay group (0 = dataset, 1 = additional, 2 = '1' plane hides '0' plane) * @param bits number of bits (stored) in the resulting array, default: 8 * @param fore foreground color to be set in bitmap, default: 255 * @param back background color to be set in bitmap (transparent), default: 0 * ** @return pointer to overlay plane data (internal memory buffer) */ const void *getOverlayData(const unsigned long frame, const unsigned int plane, unsigned int &left_pos, unsigned int &top_pos, unsigned int &width, unsigned int &height, EM_Overlay &mode, const unsigned int idx, const int bits = 8, const Uint16 fore = 0xff, const Uint16 back = 0x0); /** create bitmap for specified overlay plane. * (up to 16 bits per pixel with two values: fore and back) * ** @param frame index of frame used for output * @param plane number (0..15) or group number (0x60nn) of overlay plane * @param width returns width of overlay plane (in pixels) * @param height returns height of overlay plane (in pixels) * @param idx index of overlay group (0 = dataset, 1 = additional, 2 = '1' plane hides '0' plane) * @param bits number of bits (stored) in the resulting array, default: 8 * @param fore foreground color to be set in bitmap, default: 255 * @param back background color to be set in bitmap (transparent), default: 0 * ** @return pointer to overlay plane data (internal memory buffer) */ const void *getFullOverlayData(const unsigned long frame, const unsigned int plane, unsigned int &width, unsigned int &height, const unsigned int idx, const int bits = 8, const Uint16 fore = 0xff, const Uint16 back = 0x0); /** delete buffer for overlay plane data. * Save memory if data is no longer needed. */ void deleteOverlayData(); /** create bitmap for specified overlay plane and store it in (6xxx,3000) format. * (1 bit allocated and stored, foreground color is 1, background color is 0, * data is 16 bit padded - even length) * memory is not handled internally - must be deleted from calling program. * ** @param buffer stores pointer to overlay data (memory is allocated internally) * @param plane number (0..15) or group number (0x60nn) of overlay plane * @param width returns width of overlay plane (in pixels) * @param height returns height of overlay plane (in pixels) * @param frames returns number of frames (multiple overlay frames possible!) * @param idx index of overlay group (0 = dataset, planes stored in the image dataset; * 1 = additional, planes added by addOverlay()), * default: 0 * ** @return number of bytes allocated for the 'buffer' if successful, 0 otherwise */ unsigned long create6xxx3000OverlayData(Uint8 *&buffer, const unsigned int plane, unsigned int &width, unsigned int &height, unsigned long &frames, const unsigned int idx = 0); /** get pointer to intermediate pixel data representation * ** @return pointer to intermediate pixel data */ const DiPixel *getInterData() const { return InterData; } /** get pointer to intermediate pixel data representation * ** @return pointer to intermediate pixel data */ const DiMonoPixel *getMonoInterData() const { return InterData; } /** create true color (24/32 bit) or palette (8 bit) bitmap for MS Windows. * memory is not handled internally - must be deleted from calling program.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -