Main Page | File List | Related Pages

gdcmHeaderHelper.h

00001 // gdcmHeaderHelper.h
00002 //-----------------------------------------------------------------------------
00003 #ifndef GDCMHEADERHELPER_H
00004 #define GDCMHEADERHELPER_H
00005 
00006 #include "gdcmHeader.h"
00007 
00008 //-----------------------------------------------------------------------------
00009 // Dicom Part 3.3 Compliant
00010 enum ModalityType {
00011    Unknow,
00012    AU,       // Voice Audio
00013    AS,       // Angioscopy
00014    BI,       // Biomagnetic Imaging
00015    CF,       // Cinefluorography
00016    CP,       // Culposcopy
00017    CR,       // Computed Radiography
00018    CS,       // Cystoscopy
00019    CT,       // Computed Tomography
00020    DD,       // Duplex Dopler
00021    DF,       // Digital Fluoroscopy
00022    DG,       // Diaphanography
00023    DM,       // Digital Microscopy
00024    DS,       // Digital Substraction Angiography
00025    DX,       // Digital Radiography
00026    ECG,      // Echocardiography
00027    EPS,      // Basic Cardiac EP
00028    ES,       // Endoscopy
00029    FA,       // Fluorescein Angiography
00030    FS,       // Fundoscopy
00031    HC,       // Hard Copy
00032    HD,       // Hemodynamic
00033    LP,       // Laparoscopy
00034    LS,       // Laser Surface Scan
00035    MA,       // Magnetic Resonance Angiography
00036    MR,       // Magnetic Resonance
00037    NM,       // Nuclear Medicine
00038    OT,       // Other
00039    PT,       // Positron Emission Tomography
00040    RF,       // Radio Fluoroscopy
00041    RG,       // Radiographic Imaging
00042    RTDOSE,   // Radiotherapy Dose
00043    RTIMAGE,  // Radiotherapy Image
00044    RTPLAN,   // Radiotherapy Plan
00045    RTSTRUCT, // Radiotherapy Structure Set
00046    SM,       // Microscopic Imaging
00047    ST,       // Single-photon Emission Computed Tomography
00048    TG,       // Thermography
00049    US,       // Ultrasound
00050    VF,       // Videofluorography
00051    XA,       // X-Ray Angiography
00052    XC        // Photographic Imaging
00053 };
00054       
00055 //-----------------------------------------------------------------------------
00056 /*
00057  * \defgroup gdcmHeaderHelper
00058  * \brief  
00059  *
00060  * - This class is meant to *interpret* data given from gdcmHeader
00061  * - That is to say :
00062  *  - it will help other dev to link against there lib
00063  *  - return value instead of string
00064  *  - will be able to search for data at some other place
00065  *  - return *default value* which is not a gdcmHeader goal
00066  *  - ...
00067  */
00068 class GDCM_EXPORT gdcmHeaderHelper : public gdcmHeader {
00069 public:
00070    gdcmHeaderHelper();
00071    gdcmHeaderHelper(const char *filename, 
00072               bool  exception_on_error = false, 
00073               bool  enable_sequences   = false,
00074               bool  ignore_shadow      = false);
00075 
00076    int GetPixelSize();
00077    std::string GetPixelType();
00078    
00079    float GetXSpacing();
00080    float GetYSpacing();
00081    float GetZSpacing();
00082    
00083    // Usefull for rescaling graylevel:
00084    float GetRescaleIntercept();
00085    float GetRescaleSlope();
00086 
00087    int GetNumberOfScalarComponents();
00088    int GetNumberOfScalarComponentsRaw();
00089 
00090    std::string GetStudyUID();
00091    std::string GetSeriesUID();
00092    std::string GetClassUID();
00093    std::string GetInstanceUID();
00094    
00101    float GetXOrigin();
00102    float GetYOrigin();
00103    float GetZOrigin();
00104    
00105    int GetImageNumber();
00106    ModalityType GetModality();
00107    
00108    void GetImageOrientationPatient( float* iop );
00109 };
00110 
00111 //-----------------------------------------------------------------------------
00112 /*
00113  * \defgroup gdcmSerieHeaderHelper
00114  * \brief  
00115  *
00116  * - This class should be used for a stack of 2D dicom images.
00117  * - For a multiframe dicom image better use directly gdcmHeaderHelper
00118 */
00119 class GDCM_EXPORT gdcmSerieHeaderHelper {
00120 public:
00121     gdcmSerieHeaderHelper() {};
00122     ~gdcmSerieHeaderHelper();
00123 
00124    void AddFileName(std::string filename); //should return bool or throw error ?
00125    void AddGdcmFile(gdcmHeaderHelper *file);
00126    void SetDirectory(std::string dir);
00127    void OrderGdcmFileList();
00128    
00129    inline gdcmHeaderHelper *GetGdcmHeader()
00130    {
00131       //Assume all element in the list have the same global infos
00132       return CoherentGdcmFileList.front();
00133    }
00134    
00135    std::list<gdcmHeaderHelper*>& GetGdcmFileList();
00136 
00137 private:
00138    bool ImagePositionPatientOrdering();
00139    bool ImageNumberOrdering();
00140    bool FileNameOrdering();
00141    
00142    std::list<gdcmHeaderHelper*> CoherentGdcmFileList;
00143 };
00144 
00145 //-----------------------------------------------------------------------------
00146 #endif

Generated on Mon Feb 14 16:13:44 2005 for gdcm by doxygen 1.3.6