X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmHeader.h;h=91b92549255f7137735515769cb708e3ccb133a5;hb=45c3270f0afbdb22a10da1fa2c993125ca960304;hp=f46a12c64961f49b7575ebffdc394e4acac864e6;hpb=d4f7a5d74be3a4a332380d24631f3d0d96f98f5f;p=gdcm.git diff --git a/src/gdcmHeader.h b/src/gdcmHeader.h index f46a12c6..91b92549 100644 --- a/src/gdcmHeader.h +++ b/src/gdcmHeader.h @@ -14,10 +14,10 @@ typedef string VRKey; typedef string VRAtr; typedef map VRHT; // Value Representation Hash Table -/// \brief The purpous of an instance of gdcmHeader is to act as a container of -/// all the DICOM elements and their corresponding values (and -/// additionaly the corresponding DICOM dictionary entry) of the header -/// of a DICOM file. +/// The purpose of an instance of gdcmHeader is to act as a container of +/// all the DICOM elements and their corresponding values (and +/// additionaly the corresponding DICOM dictionary entry) of the header +/// of a DICOM file. /// /// The typical usage of instances of class gdcmHeader is to classify a set of /// dicom files according to header information e.g. to create a file hierarchy @@ -42,13 +42,14 @@ private: gdcmDictSet* Dicts; /// Public dictionary used to parse this header gdcmDict* RefPubDict; - /// Optional "shadow dictionary" (private elements) used to parse this header + /// Optional "shadow dictionary" (private elements) used to parse this + /// header gdcmDict* RefShaDict; /// ELement VALueS parsed with the PUBlic dictionary. - ElValSet PubElVals; + gdcmElValSet PubElValSet; /// ELement VALueS parsed with the SHAdow dictionary. - ElValSet ShaElVals; + gdcmElValSet ShaElValSet; /// Refering underlying filename. string filename; FILE * fp; @@ -78,6 +79,7 @@ private: void CheckSwap(void); void InitVRDict(void); void SwitchSwapToBigEndian(void); + gdcmElValue* NewManualElValToPubDict(string NewTagName, string VR); void AddAndDefaultElements(void); void SetMaxSizeLoadElementValue(long); @@ -85,16 +87,17 @@ private: gdcmDictEntry * GetDictEntryByName(string name); // ElValue related utilities - ElValue * ReadNextElement(void); - ElValue * NewElValueByKey(guint16 group, guint16 element); - ElValue * NewElValueByName(string name); - void FindLength(ElValue *); - void FindVR(ElValue *); - void LoadElementValue(ElValue *); - void LoadElementValueSafe(ElValue *); - void SkipElementValue(ElValue *); - void FixFoundLength(ElValue*, guint32); - bool IsAnInteger(ElValue *); + gdcmElValue * ReadNextElement(void); + gdcmElValue * NewElValueByKey(guint16 group, guint16 element); + gdcmElValue * NewElValueByName(string name); + void FindLength(gdcmElValue *); + void FindVR(gdcmElValue *); + void LoadElementValue(gdcmElValue *); + void LoadElementValueSafe(gdcmElValue *); + void SkipElementValue(gdcmElValue *); + void FixFoundLength(gdcmElValue*, guint32); + bool IsAnInteger(gdcmElValue *); + void LoadElements(void); bool IsImplicitVRLittleEndianTransferSyntax(void); bool IsExplicitVRLittleEndianTransferSyntax(void); @@ -104,6 +107,8 @@ private: bool IsJPEGExtendedProcess2_4TransferSyntax(void); bool IsJPEGExtendedProcess3_5TransferSyntax(void); bool IsJPEGSpectralSelectionProcess6_8TransferSyntax(void); + + bool IsJPEGLossless(void); protected: // FIXME: is this enum still necessary ?? @@ -118,7 +123,7 @@ protected: int write(ostream&); int anonymize(ostream&); // FIXME : anonymize should be a friend ? public: - void LoadElements(void); + bool IsReadable(void); virtual void ParseHeader(bool exception_on_error = false) throw(gdcmFormatError); gdcmHeader(const char *filename, bool exception_on_error = false) @@ -139,9 +144,9 @@ public: string GetPubElValRepByName(string TagName); string GetPubElValRepByNumber(guint16 group, guint16 element); - TagElValueHT & GetPubElVal(void) { return PubElVals.GetTagHt(); }; + TagElValueHT & GetPubElVal(void) { return PubElValSet.GetTagHt(); }; void PrintPubElVal(ostream & os = cout); - void PrintPubDict(ostream & os = cout); + void PrintPubDict (ostream & os = cout); // TODO Swig string* GetShaTagNames(); string GetShaElValByName(string TagName); @@ -158,8 +163,11 @@ public: int SetPubElValByNumber(string content, guint16 group, guint16 element); int SetShaElValByName(string content, string ShadowTagName); int SetShaElValByNumber(string content, guint16 group, guint16 element); + + int SetPubElValLengthByNumber(guint32 lgr, guint16 group, guint16 element); + int ReplaceOrCreateByNumber(guint16 Group, guint16 Elem, string Value); - ElValSet GetPubElVals() { return(PubElVals); } + gdcmElValSet GetPubElValSet() { return(PubElValSet); } }; #endif