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

📄 dimoimg.h

📁 转化为DIB位图再显示出来的dicom文件C++代码
💻 H
📖 第 1 页 / 共 4 页
字号:
/* * *  Copyright (C) 1996-2005, OFFIS * *  This software and supporting documentation were developed by * *    Kuratorium OFFIS e.V. *    Healthcare Information and Communication Systems *    Escherweg 2 *    D-26121 Oldenburg, Germany * *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER. * *  Module:  dcmimgle * *  Author:  Joerg Riesmeier * *  Purpose: DicomMonochromeImage (Header) * *  Last Update:      $Author: meichel $ *  Update Date:      $Date: 2005/12/08 16:47:50 $ *  CVS/RCS Revision: $Revision: 1.46 $ *  Status:           $State: Exp $ * *  CVS/RCS Log at end of file * */#ifndef DIMOIMG_H#define DIMOIMG_H#include "dcmtk/config/osconfig.h"#include "dcmtk/dcmdata/dctypes.h"#include "dcmtk/ofstd/ofcast.h"#include "dcmtk/dcmimgle/diimage.h"#include "dcmtk/dcmimgle/dimopx.h"#include "dcmtk/dcmimgle/dimoopx.h"#include "dcmtk/dcmimgle/diovlay.h"#include "dcmtk/dcmimgle/diluptab.h"#include "dcmtk/dcmimgle/didispfn.h"/*------------------------* *  forward declarations  * *------------------------*/class DiColorImage;/*---------------------* *  class declaration  * *---------------------*//** Base class for monochrome images */class DiMonoImage  : public DiImage{ public:    /** constructor     *     ** @param  docu    pointer to the DICOM document     *  @param  status  status of the image object     */    DiMonoImage(const DiDocument *docu,                const EI_Status status);    /** constructor, rescale     *     ** @param  docu       pointer to the DICOM document     *  @param  status     status of the image object     *  @param  slope      rescale slope     *  @param  intercept  rescale intercept     */    DiMonoImage(const DiDocument *docu,                const EI_Status status,                const double slope,                const double intercept);    /** constructor, modality LUT     *     ** @param  docu         pointer to the DICOM document     *  @param  status       status of the image object     *  @param  data         element containing the modality LUT data     *  @param  descriptor   element containing the modality LUT descriptor     *  @param  explanation  element containing the modality LUT explanation (optional)     */    DiMonoImage(const DiDocument *docu,                const EI_Status status,                const DcmUnsignedShort &data,                const DcmUnsignedShort &descriptor,                const DcmLongString *explanation);    /** destructor     */    virtual ~DiMonoImage();    /** get minimum and maximum pixel values.     *  the resulting pixel values are stored in 'double' variables to avoid problems     *  with different number ranges, limited to monochrome images     *     ** @param  min   minimum pixel value (reference parameter)     *  @param  max   maximum pixel value (reference parameter)     *  @param  mode  0 = min/max 'used' pixel values,     *                1 = min/max 'possible' pixel values (absolute min/max)     *     ** @return status code (true if successful)     */    int getMinMaxValues(double &min,                        double &max,                        const int mode) const;    /** get display function     *     ** @return pointer to current display function, NULL if absent     */    DiDisplayFunction *getDisplayFunction() const    {        return DisplayFunction;    }    /** set display function     *     ** @param  display  object describing the output device characteristic (only referenced!)     *     ** @return true if successful, false otherwise     */    int setDisplayFunction(DiDisplayFunction *display);    /** set no display function.     *  disables display function transformation, object is not deleted!     *     ** @return true  if successful (1 = disabled current function,     *                               2 = there was no function to disable)     *          false otherwise     */    int setNoDisplayFunction();    /** unset all VOI transformations (windows and LUTs).     *  only applicable for monochrome images     *     ** @return true if successful (1 = previous window/LUT has been valid,     *                              2 = otherwise),     *          false otherwise (image is invalid or not monochrome)     */    int setNoVoiTransformation();    /** delete specified display LUT(s)     *     ** @param  bits  parameter of LUT to be deleted (0 = all)     *     ** @return true if successful, false otherwise     */    inline int deleteDisplayLUT(const int bits)    {        return (DisplayFunction != NULL) ? DisplayFunction->deleteLookupTable(bits) : 0;    }    /** check whether given output value is unused     *     ** @param  value  output value to be checked     *     ** @return status, true if unused (1 = within output range, 2 = out of range), false otherwise     */    inline int isValueUnused(const unsigned long value)    {        return (OutputData != NULL) ? OutputData->isUnused(value) : 0;    }    /** convert P-value to DDL.     *  conversion uses display LUT if present, linear scaling otherwise.     *     ** @param  pvalue  P-value to be converted (0..65535)     *  @param  ddl     reference to resulting DDL     *  @param  bits    number of bits for output     *     ** @return true if successful (1 = display function transformation,     *                              2 = linear scaling),     *          false otherwise     */    int convertPValueToDDL(const Uint16 pvalue,                           Uint16 &ddl,                           const int bits);    /** set automatically calculated minimum/maximum window.     *  possibly active VOI LUT is implicitly disabled.     *     ** @param  idx  ignore global min/max values if false (0)     *     ** @return true if sucessful (1 = window has changed,     *                             2 = new window is the same as previous one),     *          false otherwise     */    int setMinMaxWindow(const int idx = 1);    /** set automatically calculated VOI window for the specified Region of Interest (ROI).     *  The ROI is specified by means of a rectangle (left_pos, top_pos, width, height).     *  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 the calculation     *     ** @return true if sucessful (1 = window has changed,     *                             2 = new window is the same as previous one),     *          false otherwise     */    int setRoiWindow(const unsigned long left_pos,                     const unsigned long top_pos,                     const unsigned long width,                     const unsigned long height,                     const unsigned long frame);    /** set automatically calculated histogram window.     *  possibly active VOI LUT is implicitly disabled.     *     ** @param  thresh  threshhold value specifying percentage of histogram border which shall be ignored     *     ** @return true if successful, false otherwise     */    int setHistogramWindow(const double thresh);    /** set specified window (given by index to window width/center sequence stored in image file).     *  possibly active VOI LUT is implicitly disabled.     *     ** @param  pos  index to window width/center sequence     *     ** @return true if successful, false otherwise     */    int setWindow(const unsigned long pos = 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     *  @param  explanation  window explanation (optional)     *     ** @return true if sucessful (1 = window has changed,     *                             2 = new window is the same as previous one),     *          false otherwise     */    int setWindow(const double center,                  const double width,                  const char *explanation = NULL);    /** 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     */    int getWindow(double &center,                  double &width);    /** get number of VOI windows (stored in image file)     *     ** @return number of VOI windows     */    inline unsigned long getWindowCount() const    {        return WindowCount;    }    /** set VOI LUT (given by dcmdata elements).     *  possibly active window/center is implicitly disabled.     *     ** @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     */    int setVoiLut(const DcmUnsignedShort &data,                  const DcmUnsignedShort &descriptor,                  const DcmLongString *explanation,                  const OFBool ignoreDepth = OFFalse);    /** set VOI LUT (given by index to VOI LUT sequence stored in image file).     *  possibly active window/center is implicitly disabled.     *     ** @param  pos          index to VOI LUT sequence     *  @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 setVoiLut(const unsigned long pos,                  const OFBool ignoreDepth = OFFalse);    /** get number of VOI LUTs (stored in image file)     *     ** @return number of VOI LUTs     */    inline unsigned long getVoiLutCount() const    {        return VoiLutCount;    }    /** get description of active VOI transformation     *     ** @return pointer to description text (NULL if absent)     */    inline const char *getVoiTransformationExplanation() const    {        return VoiExplanation.c_str();    }    /** get description of specified VOI window (stored in the image file)     *     ** @param  pos          index of the stored VOI window (0..n-1)     *  @param  explanation  variable in which the result text is stored     *     ** @return pointer to description text (NULL if absent or index invalid)     */    const char *getVoiWindowExplanation(const unsigned long pos,                                        OFString &explanation) const;    /** get description of specified VOI LUT (stored in the image file)     *     ** @param  pos          index of the stored VOI LUT (0..n-1)

⌨️ 快捷键说明

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