00001 
00002 
00003 #ifndef GDCMHEADER_H
00004 #define GDCMHEADER_H
00005 
00006 #include "gdcmCommon.h"
00007 #include "gdcmParser.h"
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 class GDCM_EXPORT gdcmHeader : public gdcmParser
00031 {
00032 public:
00033    gdcmHeader(bool exception_on_error = false);
00034    gdcmHeader(const char *filename, 
00035               bool  exception_on_error = false, 
00036               bool  enable_sequences   = false,
00037               bool  skip_shadow        = false);
00038               
00039    virtual ~gdcmHeader();
00040 
00041 
00042    virtual bool IsReadable(void);
00043    bool IsJPEGBaseLineProcess1TransferSyntax(void);
00044    bool IsJPEGExtendedProcess2_4TransferSyntax(void); 
00045    bool IsJPEGExtendedProcess3_5TransferSyntax(void);
00046    bool IsJPEGSpectralSelectionProcess6_8TransferSyntax(void); 
00047    bool IsRLELossLessTransferSyntax(void); 
00048    bool IsJPEGLossless(void); 
00049    bool IsJPEG2000(void); 
00050    bool IsDicomV3(void); 
00051 
00052    
00053    
00054    int GetXSize(void);
00055    int GetYSize(void);
00056    int GetZSize(void);
00057    int GetBitsStored(void);
00058    int GetBitsAllocated(void);
00059    int GetSamplesPerPixel(void);   
00060    int GetPlanarConfiguration(void);
00061 
00062    int GetPixelSize(void);   
00063    std::string GetPixelType(void);  
00064    size_t GetPixelOffset(void);
00065    size_t GetPixelAreaLength(void);
00066 
00067    bool   HasLUT(void);
00068    int    GetLUTNbits(void);
00069    unsigned char * GetLUTRGBA(void);
00070 
00071    std::string GetTransfertSyntaxName(void);
00072 
00073    
00074    
00075    
00076    
00077    
00078    
00079    
00080    
00081    
00082 
00083 
00084 
00085    inline virtual std::string GetEntryByNumber  (guint16 group, guint16 element)
00086       { return(gdcmParser::GetEntryByNumber(group,element)); }
00087    inline virtual std::string GetEntryVRByNumber(guint16 group, guint16 element)
00088       { return(gdcmParser::GetEntryVRByNumber(group,element)); }
00089       
00090    inline virtual std::string GetEntryByName    (std::string tagName) 
00091       { return(gdcmParser::GetEntryByName(tagName)); }
00092    inline virtual std::string GetEntryVRByName  (std::string tagName)
00093       { return(gdcmParser::GetEntryVRByName(tagName)); }
00094       
00095    inline virtual bool SetEntryByNumber(std::string content,guint16 group, guint16 element)
00096       { return(gdcmParser::SetEntryByNumber(content,group,element)); }
00097    inline virtual bool SetEntryByName(std::string content,std::string tagName)
00098       { return(gdcmParser::SetEntryByName(content,tagName)); }
00099 
00100   inline virtual bool SetEntryLengthByNumber(guint32 l,guint16 group, guint16 element)
00101       { return(gdcmParser::SetEntryLengthByNumber(l,group,element)); }
00102 
00103    inline virtual void UpdateShaEntries(void)
00104       { gdcmParser::UpdateShaEntries(); }
00105 
00106 
00107    void SetImageDataSize(size_t ExpectedSize);
00108 
00109    bool operator<(gdcmHeader &header);
00110 
00111 protected:
00112    int write(std::ostream&);   
00113    int anonymize(std::ostream&);  
00114    bool anonymizeHeader(void);
00115 private:
00116 
00117 };
00118 
00119 
00120 #endif