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

📄 dcmimage.h

📁 转化为DIB位图再显示出来的dicom文件C++代码
💻 H
📖 第 1 页 / 共 5 页
字号:
     *     ** @return true if successful, false otherwise     */    inline int setHistogramWindow(const double thresh = 0.05)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setHistogramWindow(thresh) : 0;    }    /** set automatically calculated VOI window for the specified Region of Interest (ROI).     *  The ROI is specified by means of a rectangle (left, top, width, height). Only the part     *  of the ROI that overlaps with the image is regarded - if the overlapping area is empty     *  this method returns false (0).     *  Possibly active VOI LUT is implicitly disabled.     *     ** @param  left_pos  x-coordinate of the top left-hand corner of the ROI (starting from 0)     *  @param  top_pos   y-coordinate of the top left-hand corner of the ROI (starting from 0)     *  @param  width     width in pixels of the rectangular ROI (minimum: 1)     *  @param  height    height in pixels of the rectangular ROI (minimum: 1)     *  @param  frame     index of the frame to be used for calculation (default: 0 = first)     *     ** @return true if sucessful (1 = window has changed,     *                             2 = new window is the same as previous one),     *          false otherwise     */    inline int setRoiWindow(const unsigned long left_pos,                            const unsigned long top_pos,                            const unsigned long width,                            const unsigned long height,                            const unsigned long frame = 0)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setRoiWindow(left_pos, top_pos, width, height, frame) : 0;    }    /** set specified window (given by index to window width/center sequence stored in image file).     *  possibly active VOI LUT is implicitly disabled.     *  NB: This function does nothing if the flag CIF_UsePresentationState is set.     *     ** @param  window  index to window width/center sequence (0..n-1)     *     ** @return true if successful, false otherwise (none monochrome or invalid index)     */    inline int setWindow(const unsigned long window)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setWindow(window) : 0;    }    /** set specified window (given by window width and center).     *  possibly active VOI LUT is implicitly disabled.     *     ** @param  center  center of specified window     *  @param  width   width of specified window (> 0.0)     *     ** @return true if sucessful (1 = window has changed,     *                             2 = new window is the same as previous one),     *          false otherwise     */    inline int setWindow(const double center,                         const double width)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setWindow(center, width) : 0;    }    /** get current window center and width values     *     ** @param  center  return current window center value     *  @param  width   return current window width value     *     ** @return true if successful, false otherwise     */    inline int getWindow(double &center,                         double &width)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getWindow(center, width) : 0;    }    /** get number of VOI windows (stored in image file).     *  NB: This function does nothing if the flag CIF_UsePresentationState is set.     *     ** @return number of VOI windows     */    inline unsigned long getWindowCount() const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getWindowCount() : 0;    }    /** set VOI LUT (given by dcmdata elements).     *  possibly active window/center is implicitly disabled.     *  Given data is only referenced and not copied! Make sure that the corresponding DcmXXX     *  objects exist as long as the VOI LUT is set.     *     ** @param  data         contains LUT data     *  @param  descriptor   describes LUT structure     *  @param  explanation  free form description of VOI 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     */    inline int setVoiLut(const DcmUnsignedShort &data,                         const DcmUnsignedShort &descriptor,                         const DcmLongString *explanation = NULL,                         const OFBool ignoreDepth = OFFalse)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setVoiLut(data, descriptor, explanation, ignoreDepth) : 0;    }    /** set VOI LUT (given by index to VOI LUT sequence stored in image file).     *  possibly active window/center is implicitly disabled.     *  NB: This function does nothing if the flag CIF_UsePresentationState is set.     *     ** @param  table  index to VOI LUT sequence (0..n-1)     *  @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 (none monochrome or invalid index)     */    inline int setVoiLut(const unsigned long table,                         const OFBool ignoreDepth = OFFalse)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setVoiLut(table, ignoreDepth) : 0;    }    /** get number of VOI LUTs (stored in image file)     *     ** @return number of VOI LUTs     */    inline unsigned long getVoiLutCount() const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getVoiLutCount() : 0;    }    /** get description of active VOI transformation     *     ** @return pointer to description text (NULL if absent)     */    inline const char *getVoiTransformationExplanation() const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getVoiTransformationExplanation() : OFstatic_cast(const char *, NULL);    }    /** get description of specified VOI window (stored in the image file)     *     ** @param  window       index of the stored VOI window (0..n-1)     *  @param  explanation  variable in which the explanation string is stored     *     ** @return pointer to description text (NULL if absent or index invalid)     */    inline const char *getVoiWindowExplanation(const unsigned long window,                                               OFString &explanation) const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getVoiWindowExplanation(window, explanation) : OFstatic_cast(const char *, NULL);    }    /** get description of specified VOI LUT (stored in the image file)     *     ** @param  table        index of the stored VOI LUT (0..n-1)     *  @param  explanation  variable in which the explanation string is stored     *     ** @return pointer to description text (NULL if absent or index invalid)     */    inline const char *getVoiLutExplanation(const unsigned long table,                                            OFString &explanation) const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getVoiLutExplanation(table, explanation) : OFstatic_cast(const char *, NULL);    }    /** get description of performed modality LUT transformation     *     ** @return pointer to description text (NULL if absent)     */    inline const char *getModalityLutExplanation() const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getModalityLutExplanation() : OFstatic_cast(const char *, NULL);    } // --- hardcopy parameters    /** get polarity. applicable to monochrome and color images.     *  possible values are EPP_Normal and EPP_Reverse     *     ** @return currently active polarity mode or EPP_Normal if not applicable     */    inline EP_Polarity getPolarity() const    {        return (Image != NULL) ?            Image->getPolarity() : EPP_Normal;    }    /** set polarity. applicable to monochrome and color images.     *     ** @param  polarity  polarity (normal or reverse)     *     ** @return true if successful (1 = polarity has changed,     *                              2 = polarity has not changed)     *          false otherwise     */    inline int setPolarity(const EP_Polarity polarity)    {        return (Image != NULL) ?            Image->setPolarity(polarity) : 0;    }    /** set hardcopy parameters. only applicable to monochrome images.     *  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     */    inline int setHardcopyParameters(const unsigned int min,                                     const unsigned int max,                                     const unsigned int reflect,                                     const unsigned int illumin)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setHardcopyParameters(min, max, reflect, illumin) : 0;    } // --- presentation LUT: only applicable to grayscale images    /** 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 or ESP_Default if not set     */    inline ES_PresentationLut getPresentationLutShape() const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getPresentationLutShape() : ESP_Default;    }    /** set shape for presentation transformation.     *  possibly active presentation LUT is implicitly disabled.     *     ** @param  shape  presentation LUT shape (default, identity, inverse or lin OD).     *                 '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     */    inline int setPresentationLutShape(const ES_PresentationLut shape)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setPresentationLutShape(shape) : 0;    }    /** set LUT for presentation transformation.     *  possibly active presentation LUT is implicitly disabled.     *  Given data is only referenced and not copied! Make sure that the corresponding DcmXXX     *  objects exist as long as the presentation LUT is set.     *     ** @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     */    inline int setPresentationLut(const DcmUnsignedShort &data,                                  const DcmUnsignedShort &descriptor,                                  const DcmLongString *explanation = NULL,                                  const OFBool ignoreDepth = OFFalse)    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->setPresentationLut(data, descriptor, explanation, ignoreDepth) : 0;    }    /** get description of active presentation LUT     *

⌨️ 快捷键说明

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