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

📄 diutils.h

📁 转化为DIB位图再显示出来的dicom文件C++代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * *  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: Utilities (Header) * *  Last Update:      $Author: meichel $ *  Update Date:      $Date: 2005/12/08 16:48:12 $ *  CVS/RCS Revision: $Revision: 1.31 $ *  Status:           $State: Exp $ * *  CVS/RCS Log at end of file * */#ifndef DIUTILS_H#define DIUTILS_H#include "dcmtk/config/osconfig.h"#include "dcmtk/dcmdata/dctypes.h"#include "dcmtk/ofstd/ofglobal.h"#include "dcmtk/ofstd/ofcast.h"#define INCLUDE_CSTDLIB#define INCLUDE_CSTDIO#define INCLUDE_LIBC#include "dcmtk/ofstd/ofstdinc.h"/*---------------------* *  const definitions  * *---------------------*//** @name configuration flags *///@{/// compatibility with old ACR-NEMA imagesconst unsigned long CIF_AcrNemaCompatibility         = 0x0000001;/// accept wrong palette attribute tagsconst unsigned long CIF_WrongPaletteAttributeTags    = 0x0000002;/// element pixel data may be detached if it is no longer needed by dcmimageconst unsigned long CIF_MayDetachPixelData           = 0x0000004;/// use presentation state instead of 'built-in' LUTs & overlaysconst unsigned long CIF_UsePresentationState         = 0x0000008;/// don't convert YCbCr (Full and Full 4:2:2) color images to RGBconst unsigned long CIF_KeepYCbCrColorModel          = 0x0000010;/// take responsibility for the given external DICOM dataset, i.e. delete it on destructionconst unsigned long CIF_TakeOverExternalDataset      = 0x0000020;/// ignore modality transformation (rescale slope/intercept or LUT) stored in the datasetconst unsigned long CIF_IgnoreModalityTransformation = 0x0000040;/// ignore third value of the modality LUT descriptor, determine bit depth automaticallyconst unsigned long CIF_IgnoreModalityLutBitDepth    = 0x0000080;//@}// / true color color mode (for monochrome images only)const int MI_PastelColor = -1;/*--------------------* *  type definitions  * *--------------------*//** constants for photometric interpretation */enum EP_Interpretation{    /// unknown, undefined, invalid    EPI_Unknown,    /// monochrome 1    EPI_Monochrome1,    /// monochrome 2    EPI_Monochrome2,    /// palette color    EPI_PaletteColor,    /// RGB color    EPI_RGB,    /// HSV color (retired)    EPI_HSV,    /// ARGB color (retired)    EPI_ARGB,    /// CMYK color (retired)    EPI_CMYK,    /// YCbCr full    EPI_YBR_Full,    /// YCbCr full 4:2:2    EPI_YBR_Full_422,    /// YCbCr partial 4:2:2    EPI_YBR_Partial_422};/** structure for photometric string and related constant */struct SP_Interpretation{    /// string    const char *Name;    /// constant    EP_Interpretation Type;};/** structure for BMP bitmap file header */struct SB_BitmapFileHeader{    /// signature, must always be 'BM'    char bfType[2];    /// file size in bytes    Uint32 bfSize;    /// reserved, should be '0'    Uint16 bfReserved1;    /// reserved, should be '0'    Uint16 bfReserved2;    /// offset from the beginning of the file to the bitmap data (in bytes)    Uint32 bfOffBits;};/** structure for BMP bitmap info header */struct SB_BitmapInfoHeader{    /// size of the BitmapInfoHeader, usually '40'    Uint32 biSize;    /// width of the image (in pixels)    Sint32 biWidth;    /// height of the image (in pixels)    Sint32 biHeight;    /// number of planes, usually '1'    Uint16 biPlanes;    /// bits per pixel, supported values: 8 = color palette with 256 entries, 24 = true color    Uint16 biBitCount;    /// type of compression, support value: 0 = BI_RGB, no compression    Uint32 biCompression;    /// size of the image data (in bytes), might be set to '0' if image is uncompressed    Uint32 biSizeImage;    /// horizontal resolution: pixels/meter, usually set to '0'    Sint32 biXPelsPerMeter;    /// vertical resolution: pixels/meter, usually set to '0'    Sint32 biYPelsPerMeter;    /// number of actually used colors, if '0' the number of colors is calculated using 'biBitCount'    Uint32 biClrUsed;    /// number of important colors, '0' means all    Uint32 biClrImportant;};/** internal representation of pixel data */enum EP_Representation{    /// unsigned 8 bit integer    EPR_Uint8, EPR_MinUnsigned = EPR_Uint8,    /// signed 8 bit integer    EPR_Sint8, EPR_MinSigned = EPR_Sint8,    /// unsigned 16 bit integer    EPR_Uint16,    /// signed 16 bit integer    EPR_Sint16,    /// unsigned 32 bit integer    EPR_Uint32, EPR_MaxUnsigned = EPR_Uint32,    /// signed 32 bit integer    EPR_Sint32, EPR_MaxSigned = EPR_Sint32};/** image status code */enum EI_Status{    /// normal, no error    EIS_Normal,    /// data dictionary not found    EIS_NoDataDictionary,    /// invalid dataset/file    EIS_InvalidDocument,    /// mandatory attribute missing    EIS_MissingAttribute,    /// invalid value for an important attribute    EIS_InvalidValue,    /// specified value for an attribute not supported    EIS_NotSupportedValue,    /// memory exhausted etc.    EIS_MemoryFailure,    /// invalid image, internal error    EIS_InvalidImage,    /// other error    EIS_OtherError};/** overlay modes. *  This mode is used to define how to display an overlay plane. */enum EM_Overlay{    /// default mode, as stored in the dataset    EMO_Default,    /// replace mode    EMO_Replace,    /// graphics overlay    EMO_Graphic = EMO_Replace,    /// threshold replace    EMO_ThresholdReplace,    /// complement    EMO_Complement,    /// invert the overlay bitmap    EMO_InvertBitmap,    /// region of interest (ROI)     EMO_RegionOfInterest,    /// bitmap shutter, used for GSPS objects    EMO_BitmapShutter};/** presentation LUT shapes */enum ES_PresentationLut{    /// default shape (not explicitly set)    ESP_Default,    /// shape IDENTITY    ESP_Identity,    /// shape INVERSE    ESP_Inverse,    /// shape LIN OD    ESP_LinOD};/** polarity */enum EP_Polarity{    /// NORMAL    EPP_Normal,    /// REVERSE (opposite polarity)    EPP_Reverse};/*----------------------------* *  constant initializations  * *----------------------------*/const SP_Interpretation PhotometricInterpretationNames[] =

⌨️ 快捷键说明

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