X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmParser.h;h=1a84b010d7cceb1ab54acc6089f5768ce78df04a;hb=c38654db595b51f0295f607c51172dae56d1d65d;hp=8767a1d4b99e13fe0880b971bbbd796508af533f;hpb=55d77e0913ff360d639af1841c70d14dc8687584;p=gdcm.git diff --git a/src/gdcmParser.h b/src/gdcmParser.h index 8767a1d4..1a84b010 100644 --- a/src/gdcmParser.h +++ b/src/gdcmParser.h @@ -35,12 +35,6 @@ typedef std::map GroupHT; class GDCM_EXPORT gdcmParser { public: - gdcmParser(bool exception_on_error = false); - gdcmParser(const char *inFilename, - bool exception_on_error = false, - bool enable_sequences = false, - bool ignore_shadow = false); - virtual ~gdcmParser(void); // Print /** @@ -105,8 +99,8 @@ public: // Write (used in gdcmFile, gdcmDicomDir) virtual bool Write(FILE *, FileType); - bool ReplaceOrCreateByNumber(std::string Value, guint16 Group, guint16 Elem); - bool ReplaceOrCreateByNumber( char *Value, guint16 Group, guint16 Elem); + gdcmHeaderEntry * ReplaceOrCreateByNumber(std::string Value, guint16 Group, guint16 Elem); + gdcmHeaderEntry * ReplaceOrCreateByNumber( char *Value, guint16 Group, guint16 Elem); bool ReplaceIfExistByNumber ( char *Value, guint16 Group, guint16 Elem); // System access @@ -126,6 +120,15 @@ public: guint32 UnswapLong(guint32); // needed by gdcmFile protected: +// constructor and destructor are protected to forbid end user +// to instanciate class gdcmParser +// (only gdcmHeader and gdcmDicomDir are meaningfull) + gdcmParser(bool exception_on_error = false); + gdcmParser(const char *inFilename, + bool exception_on_error = false, + bool enable_sequences = false, + bool ignore_shadow = false); + virtual ~gdcmParser(void); // Entry int CheckIfEntryExistByNumber(guint16 Group, guint16 Elem ); // int ! virtual std::string GetEntryByName (std::string tagName); @@ -159,7 +162,14 @@ protected: void WriteEntriesDeprecated(FILE *_fp,FileType type); // JPR void AddHeaderEntry (gdcmHeaderEntry *); - + + /** + * \ingroup gdcmParser + * \brief Set the external File Name + */ + inline void SetFileName(char* fileName) + {filename = fileName;} + // Variables /** * \brief File Pointer, open during Header parsing @@ -170,8 +180,11 @@ protected: */ FileType filetype; +/// after opening the file, we read HEADER_LENGTH_TO_READ bytes. static const unsigned int HEADER_LENGTH_TO_READ; +/// Elements whose value is longer than MAX_SIZE_LOAD_ELEMENT_VALUE are NOT loaded static const unsigned int MAX_SIZE_LOAD_ELEMENT_VALUE; +/// Elements whose value is longer than MAX_SIZE_PRINT_ELEMENT_VALUE are NOT printed static const unsigned int MAX_SIZE_PRINT_ELEMENT_VALUE; protected: @@ -257,11 +270,10 @@ private: gdcmHeaderEntry *NewHeaderEntryByNumber(guint16 group, guint16 element); gdcmHeaderEntry *NewHeaderEntryByName (std::string Name); - - + // Deprecated (Not used) --> commented out //gdcmHeaderEntry *NewManualHeaderEntryToPubDict(std::string NewTagName, - // std::string VR); + // std::string VR); guint32 GenerateFreeTagKeyInGroup(guint16 group); @@ -296,15 +308,15 @@ private: */ int sw; /** - * \brief Size treshold above which an element value will NOT be loaded in + * \brief Size threshold above which an element value will NOT be loaded in * memory (to avoid loading the image/volume itself). By default, * this upper bound is fixed to 1024 bytes (which might look reasonable - * when one considers the definition of the various VR contents). + * when one considers the definition of the various VR contents). */ guint32 MaxSizeLoadEntry; /** - * \brief Size treshold above which an element value will NOT be *printed* in + * \brief Size threshold above which an element value will NOT be *printed* in * order no to polute the screen output. * By default, this upper bound is fixed to 64 bytes. */