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

📄 dcmimage.h

📁 转化为DIB位图再显示出来的dicom文件C++代码
💻 H
📖 第 1 页 / 共 5 页
字号:
            Image->getOverlayPtr(idx)->getPlaneMode(plane) : EMO_Default;    }    /** create bitmap for specified overlay plane.     *  (up to 16 bits per pixel with two values: 'fore' and 'back')     *  Please note that the current origin of the overlay plane is used.  Furthermore, the size     *  of the overlay plane is restricted to the size of the surrounding image.  Use the method     *  getFullOverlayData() if the complete bitmap data is required regardless of its position.     *     ** @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  left_pos  returns x coordinate of plane's origin     *  @param  top_pos   returns y coordinate of plane's origin     *  @param  mode      returns display mode (see 'diutils.h')     *  @param  frame     index of frame used for output (default: 0 = first)     *  @param  bits      number of bits (stored) in the resulting array, default: 8, range: 1..16     *                    Used to mask the values for foreground and background color.  The resulting     *                    array is always padded to 8 or 16 bits with 1, 8 or 16 bits allocated     *                    depending on the value of 'bits'.     *  @param  fore      foreground color to be set in bitmap, default: 255, range: 0..2^bits-1     *  @param  back      background color to be set in bitmap (transparent), default: 0, range: 0..2^bits-1     *  @param  idx       index of overlay group (0 = dataset, planes stored in the image dataset;     *                                            1 = additional, planes added by addOverlay();     *                                            2 = 'additional' overlay planes hide 'dataset' planes     *                                                when the overlay group number exists in both),     *                    default: 2     *     ** @return pointer to overlay plane data (internal memory buffer)     */    const void *getOverlayData(const unsigned int plane,                               unsigned int &left_pos,                               unsigned int &top_pos,                               unsigned int &width,                               unsigned int &height,                               EM_Overlay &mode,                               const unsigned long frame = 0,                               const int bits = 8,                               const Uint16 fore = 0xff,                               const Uint16 back = 0x0,                               const unsigned int idx = 2) const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getOverlayData(frame, plane, left_pos, top_pos, width, height, mode, idx, bits, fore, back) : NULL;    }    /** create bitmap for specified overlay plane.     *  (up to 16 bits per pixel with two values: 'fore' and 'back')     *  In contrast to the previous method the full bitmap data is always returned.     *     ** @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  frame   index of frame used for output (default: 0 = first)     *  @param  bits    number of bits (stored) in the resulting array, default: 8, range: 1..16     *                  Used to mask the values for foreground and background color.  The resulting     *                  array is always padded to 8 or 16 bits with 1, 8 or 16 bits allocated     *                  depending on the value of 'bits'.     *  @param  fore    foreground color to be set in bitmap, default: 255, range: 0..2^bits-1     *  @param  back    background color to be set in bitmap (transparent), default: 0, range: 0..2^bits-1     *  @param  idx     index of overlay group (0 = dataset, planes stored in the image dataset;     *                                          1 = additional, planes added by addOverlay()),     *                  default: 0     *     ** @return pointer to overlay plane data (internal memory buffer)     */    const void *getFullOverlayData(const unsigned int plane,                                   unsigned int &width,                                   unsigned int &height,                                   const unsigned long frame = 0,                                   const int bits = 8,                                   const Uint16 fore = 0xff,                                   const Uint16 back = 0x0,                                   const unsigned int idx = 0) const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->getFullOverlayData(frame, plane, width, height, idx, bits, fore, back) : NULL;    }    /** delete buffer for overlay plane data.     *  Save memory if data is no longer needed.     */    inline void deleteOverlayData() const    {        if ((Image != NULL) && (Image->getMonoImagePtr() != NULL))            Image->getMonoImagePtr()->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 allocated but 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     *  @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) const    {        return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?            Image->getMonoImagePtr()->create6xxx3000OverlayData(buffer, plane, width, height, frames, idx) : 0;    } // --- create...Image: return pointer to new 'DicomImage' object, memory isn't handled internally !    /** create copy of current image object.     *  memory is not handled internally - must be deleted from calling program.     *     ** @param  fstart  first frame to be processed (0 = 1st frame)     *  @param  fcount  number of frames (0 = all frames)     *     ** @return pointer to new DicomImage object (NULL if an error occurred)     */    DicomImage *createDicomImage(unsigned long fstart = 0,                                 unsigned long fcount = 0) const;    /** create scaled copy of current image object (given by exact size).     *  memory is not handled internally - must be deleted from calling program.     *     ** @param  width        width of new image (in pixels)     *  @param  height       height of new image (in pixels)     *  @param  interpolate  specifies whether scaling algorithm should use interpolation (if necessary)     *                       default: no interpolation (0), 1 = pbmplus algorithm, 2 = c't algorithm     *  @param  aspect       specifies whether pixel aspect ratio should be taken into consideration     *                       (if true, width OR height should be 0, i.e. this component will be calculated     *                        automatically)     *     ** @return pointer to new DicomImage object (NULL if an error occurred)     */    DicomImage *createScaledImage(const unsigned long width,                                  const unsigned long height = 0,                                  const int interpolate = 0,                                  int aspect = 0) const;    /** create scaled copy of current image object (given by scaling factors).     *  memory is not handled internally - must be deleted from calling program.     *     ** @param  xfactor      width of new image is multiplied with this factor (> 0)     *  @param  yfactor      height of new image is multiplied with this factor (> 0)     *  @param  interpolate  specifies whether scaling algorithm should use interpolation (if necessary)     *                       default: no interpolation (0), 1 = pbmplus algorithm, 2 = c't algorithm     *  @param  aspect       specifies whether pixel aspect ratio should be taken into consideration     *                       (if true, width OR height should be 0, i.e. this component will be calculated     *                        automatically)     *     ** @return pointer to new DicomImage object (NULL if an error occurred)     */    DicomImage *createScaledImage(const double xfactor,                                  const double yfactor = 0,                                  const int interpolate = 0,                                  const int aspect = 0) const;    /** create scaled copy of specified (clipping) area of the current image object.     *  memory is not handled internally - must be deleted from calling program.     *  NB: clipping and interpolated scaling at the same moment is not yet fully implemented!     *     ** @param  left_pos      x coordinate of top left corner of area to be scaled     *                        (referring to image origin, negative values create a border around the image)     *  @param  top_pos       y coordinate of top left corner of area to be scaled     *  @param  clip_width    width of area to be scaled     *  @param  clip_height   height of area to be scaled     *  @param  scale_width   width of scaled image (in pixels)     *  @param  scale_height  height of scaled image (in pixels)     *  @param  interpolate   specifies whether scaling algorithm should use interpolation (if necessary)     *                        default: no interpolation (0), 1 = pbmplus algorithm, 2 = c't algorithm     *  @param  aspect        specifies whether pixel aspect ratio should be taken into consideration     *                        (if true, width OR height should be 0, i.e. this component will be calculated     *                         automatically)     *  @param  pvalue        P-value used for the border outside the image (0..65535)     *     ** @return pointer to new DicomImage object (NULL if an error occurred)     */    DicomImage *createScaledImage(const signed long left_pos,                                  const signed long top_pos,                                  unsigned long clip_width,                                  unsigned long clip_height,                                  unsigned long scale_width = 0,                                  unsigned long scale_height = 0,                                  const int interpolate = 0,                                  int aspect = 0,                                  const Uint16 pvalue = 0) const;    /** create scaled copy of specified (clipping) area of the current image object.     *  memory is not handled internally - must be deleted from calling program.     *  NB: clipping and interpolated scaling at the same moment is not yet fully implemented!     *     ** @param  left_pos     x coordinate of top left corner of area to be scaled     *                       (referring to image orgin, negative values create a border around the image)     *  @param  top_pos      y coordinate of top left corner of area to be scaled     *  @param  width        width of area to be scaled     *  @param  height       height of area to be scaled     *  @param  xfactor      width of new image is multiplied with this factor (> 0)     *  @param  yfactor      height of new image is multiplied with this factor (> 0)     *  @param  interpolate  specifies whether scaling algorithm should use interpolation (if necessary)     *                       default: no interpolation (0), 1 = pbmplus algorithm, 2 = c't algorithm     *  @param  aspect       specifies whether pixel aspect ratio should be taken into consideration     *                       (if true, width OR height should be 0, i.e. this component will be calculated     *                        automatically)     *  @param  pvalue       P-value used for the border outside the image (0..65535)     *     ** @return pointer to new DicomImage object (NULL if an error occurred)     */    DicomImage *createScaledImage(const signed long left_pos,                                  const signed long top_pos,                                  unsigned long width,                                  unsigned long height,                                  const double xfactor,                                  const double yfactor = 0,                                  const int interpolate = 0,                                  const int aspect = 0,                                  const Uint16 pvalue = 0) const;    /** create copy of specified area of the current image object (clipping).     *  memory is not handled internally - must be deleted from calling program.     *     ** @param  left_pos  x coordinate of top left corner of area to be copied     *                    (referring to image orgin, negative values create a border around the image)     *  @param  top_pos   y coordinate of top left corner of area to be copied     *  @param  width     width of area to be copied/clipped     *  @param  height    height of area to be copied/clipped     *  @param  pvalue    P-value used for the border outside the image (0..65535)     *     ** @return pointer to new DicomImage object (NULL if an error occurred)     */    DicomImage *createClippedImage(const signed long left_pos,                                   const signed long top_pos,                                   unsigned long width = 0,                                   unsigned long height = 0,                                   const Uint16 pvalue = 0) const;    /** 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 flipImage(int horz = 1,                  int vert = 0) const;    /** create a flipped copy of the current image.     *  memory is not handled internally - must be deleted from calling program.     *     ** @param  horz  flip horizontally if true     *  @param  vert  flip vertically if true     *     ** @return pointer to new DicomImage object (NULL if an error occurred)     */    DicomImage *createFlippedImage(int horz = 1,                                   int vert = 0) const;    /** 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 rotateImage(signed int degree) const;    /** create a rotated copy of the current image.     *  memory is not handled internally - must be deleted from calling program.     *     ** @param  degree  angle by which the image shall be rotated (-360, -270, -180, -90, 0, 90, 180, 270, 360)     *     ** @return pointer to new DicomImage object (NULL if an error occurred)     */    DicomImage *createRotatedImage(signed int degree) const;    /** create monochrome copy of the current image.     *  equal to createDicomImage() for monochrome images.     *  memory is not handled internally - must be deleted from calling program.     *  This method does not work if original YCbCr color model is retained (see CIF_KeepYCbCrColorModel).     *     ** @param  red    coefficient by which the red component is weighted (default: NTSC v

⌨️ 快捷键说明

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