X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmHeader.h;h=ae885cf8bf676eeba087465e7a5e93c3bd782127;hb=6cf458fe8d13f8b577a62802650afc6f67c720a0;hp=5e43f564460f3fec9966d1ef1766e0a9ccad7f7a;hpb=595f90023c498f01bba240043841088ba5d45872;p=gdcm.git diff --git a/src/gdcmHeader.h b/src/gdcmHeader.h index 5e43f564..ae885cf8 100644 --- a/src/gdcmHeader.h +++ b/src/gdcmHeader.h @@ -1,10 +1,11 @@ -// gdcmHeader.h +// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.23 2003/05/12 14:32:43 frog Exp $ #ifndef GDCMHEADER_H #define GDCMHEADER_H #include #include "gdcmCommon.h" +#include "gdcmUtil.h" #include "gdcmException.h" #include "gdcmDictSet.h" #include "gdcmElValue.h" @@ -36,10 +37,9 @@ class GDCM_EXPORT gdcmHeader { private: /// Pointer to the Value Representation Hash Table which contains all /// the VR of the DICOM version3 public dictionary. - static VRHT *dicom_vr; - - /// Global dictionary container - gdcmDictSet* Dicts; + gdcmVR *dicom_vr; // Not a class member for thread-safety reasons + /// Pointer to global dictionary container + gdcmDictSet* Dicts; // Not a class member for thread-safety reasons /// Public dictionary used to parse this header gdcmDict* RefPubDict; /// Optional "shadow dictionary" (private elements) used to parse this @@ -52,7 +52,6 @@ private: gdcmElValSet ShaElValSet; /// Refering underlying filename. string filename; - FILE * fp; // FIXME sw should be an enum e.g. //enum EndianType { @@ -72,24 +71,22 @@ private: guint16 ReadInt16(void); guint32 ReadInt32(void); - guint16 SwapShort(guint16); - guint32 SwapLong(guint32); guint32 FindLengthOB(void); void Initialise(void); void CheckSwap(void); - void InitVRDict(void); void SwitchSwapToBigEndian(void); // CLEAN ME: NewManualElValToPubDict is NOT called any more. gdcmElValue* NewManualElValToPubDict(string NewTagName, string VR); void SetMaxSizeLoadElementValue(long); - gdcmDictEntry * GetDictEntryByKey(guint16, guint16); + gdcmDictEntry * GetDictEntryByNumber(guint16, guint16); gdcmDictEntry * GetDictEntryByName(string name); // ElValue related utilities gdcmElValue * ReadNextElement(void); - gdcmElValue * NewElValueByKey(guint16 group, guint16 element); + gdcmElValue * NewElValueByNumber(guint16 group, guint16 element); gdcmElValue * NewElValueByName(string name); + void FindLength(gdcmElValue *); void FindVR(gdcmElValue *); void LoadElementValue(gdcmElValue *); @@ -99,6 +96,21 @@ private: bool IsAnInteger(gdcmElValue *); void LoadElements(void); +protected: + FILE * fp; + FileType filetype; + + gdcmElValue * GetElValueByNumber(guint16 group, guint16 element); + + guint16 SwapShort(guint16); // needed by gdcmFile + guint32 SwapLong(guint32); // for JPEG Files :-( + bool OpenFile(bool exception_on_error = false) + throw(gdcmFileError); + bool CloseFile(void); + int write(ostream&); + int anonymize(ostream&); // FIXME : anonymize should be a friend ? +public: + bool IsReadable(void); bool IsImplicitVRLittleEndianTransferSyntax(void); bool IsExplicitVRLittleEndianTransferSyntax(void); bool IsDeflatedExplicitVRLittleEndianTransferSyntax(void); @@ -107,24 +119,15 @@ private: bool IsJPEGExtendedProcess2_4TransferSyntax(void); bool IsJPEGExtendedProcess3_5TransferSyntax(void); bool IsJPEGSpectralSelectionProcess6_8TransferSyntax(void); - bool IsJPEGLossless(void); bool IsDicomV3(void); -protected: - FileType filetype; - int write(ostream&); - int anonymize(ostream&); // FIXME : anonymize should be a friend ? -public: - bool IsReadable(void); virtual void ParseHeader(bool exception_on_error = false) throw(gdcmFormatError); - gdcmHeader(const char *filename, bool exception_on_error = false) - throw(gdcmFileError); + gdcmHeader(const char *filename, bool exception_on_error = false); virtual ~gdcmHeader(); size_t GetPixelOffset(void); - void GetPixels(size_t, void *); int GetSwapCode(void) { return sw; } // TODO Swig int SetPubDict(string filename); @@ -162,6 +165,7 @@ public: int GetXSize(void); int GetYSize(void); int GetZSize(void); + int GetPixelSize(void); string GetPixelType(void); int Write(FILE *, FileType);