00001 
00002 
00003 #ifndef GDCMHEADERHELPER_H
00004 #define GDCMHEADERHELPER_H
00005 
00006 #include "gdcmHeader.h"
00007 
00008 
00009 
00010 enum ModalityType {
00011    Unknow,
00012    AU,       
00013    AS,       
00014    BI,       
00015    CF,       
00016    CP,       
00017    CR,       
00018    CS,       
00019    CT,       
00020    DD,       
00021    DF,       
00022    DG,       
00023    DM,       
00024    DS,       
00025    DX,       
00026    ECG,      
00027    EPS,      
00028    ES,       
00029    FA,       
00030    FS,       
00031    HC,       
00032    HD,       
00033    LP,       
00034    LS,       
00035    MA,       
00036    MR,       
00037    NM,       
00038    OT,       
00039    PT,       
00040    RF,       
00041    RG,       
00042    RTDOSE,   
00043    RTIMAGE,  
00044    RTPLAN,   
00045    RTSTRUCT, 
00046    SM,       
00047    ST,       
00048    TG,       
00049    US,       
00050    VF,       
00051    XA,       
00052    XC        
00053 };
00054       
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
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    
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 
00114 
00115 
00116 
00117 
00118 
00119 class GDCM_EXPORT gdcmSerieHeaderHelper {
00120 public:
00121     gdcmSerieHeaderHelper() {};
00122     ~gdcmSerieHeaderHelper();
00123 
00124    void AddFileName(std::string filename); 
00125    void AddGdcmFile(gdcmHeaderHelper *file);
00126    void SetDirectory(std::string dir);
00127    void OrderGdcmFileList();
00128    
00129    inline gdcmHeaderHelper *GetGdcmHeader()
00130    {
00131       
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