Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2005/01/26 17:17:31 $
- Version: $Revision: 1.102 $
+ Date: $Date: 2005/02/11 16:36:52 $
+ Version: $Revision: 1.106 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT Document : public ElementSet
{
public:
-// Informations contained in the gdcm::Document
- virtual bool IsReadable();
- FileType GetFileType();
- std::string GetTransferSyntax();
+typedef std::list<Element> ListElements;
// Dictionaries
- virtual void PrintPubDict (std::ostream &os = std::cout);
- virtual void PrintShaDict (std::ostream &os = std::cout);
-
- Dict* GetPubDict();
- Dict* GetShaDict();
- bool SetShaDict(Dict* dict);
+ Dict *GetPubDict();
+ Dict *GetShaDict();
+ bool SetShaDict(Dict *dict);
bool SetShaDict(DictKey const &dictName);
+// Informations contained in the gdcm::Document
+ virtual bool IsReadable();
+ bool IsDicomV3();
+ bool IsPapyrus();
+ FileType GetFileType();
+ std::string GetTransferSyntax();
+ /// Return the Transfer Syntax as a string
+ std::string GetTransferSyntaxName();
+
// Swap code
/// 'Swap code' accessor (see \ref SwapCode )
int GetSwapCode() { return SwapCode; }
// System access (meaning endian related !?)
- uint16_t SwapShort(uint16_t); // needed by Document
- uint32_t SwapLong(uint32_t); // needed by Document
- uint16_t UnswapShort(uint16_t); // needed by Document
- uint32_t UnswapLong(uint32_t); // needed by Document
+ uint16_t SwapShort(uint16_t);
+ uint32_t SwapLong(uint32_t);
+ /// \brief Unswaps back the bytes of 2-bytes long integer
+ /// so they agree with the processor order.
+ uint16_t UnswapShort(uint16_t a) { return SwapShort(a);}
+ /// \brief Unswaps back the bytes of 4-byte long integer
+ /// so they agree with the processor order.
+ uint32_t UnswapLong(uint32_t a) { return SwapLong(a);}
-// Ordering of Documents
- bool operator<(Document &document);
-
-public:
// File I/O
/// Accessor to \ref Filename
const std::string &GetFileName() const { return Filename; }
void WriteContent( std::ofstream *fp, FileType type );
// Content entries
-
virtual void LoadEntryBinArea(uint16_t group, uint16_t elem);
virtual void LoadEntryBinArea(BinEntry *entry);
void LoadDocEntrySafe(DocEntry *entry);
-
- /// Return the Transfer Syntax as a string
- std::string GetTransferSyntaxName();
-
- bool IsDicomV3();
- bool IsPapyrus();
+
+// Ordering of Documents
+ bool operator<(Document &document);
protected:
// Methods
uint16_t ReadInt16() throw ( FormatError );
uint32_t ReadInt32() throw ( FormatError );
void SkipBytes(uint32_t);
-
int ComputeGroup0002Length( FileType filetype );
// Variables
/// are NOT printed.
static const unsigned int MAX_SIZE_PRINT_ELEMENT_VALUE;
+ /// List of element to Anonymize
+ ListElements AnonymizeList;
+
private:
// Methods
+ void Initialize();
+
// Read
void ParseDES(DocEntrySet *set,long offset, long l_max, bool delim_mode);
void ParseSQ (SeqEntry *seq, long offset, long l_max, bool delim_mode);
std::string GetDocEntryValue (DocEntry *entry);
std::string GetDocEntryUnvalue(DocEntry *entry);
-
void SkipDocEntry (DocEntry *entry);
void SkipToNextDocEntry (DocEntry *entry);
void FixDocEntryFoundLength(DocEntry *entry,uint32_t l);
bool IsDocEntryAnInteger (DocEntry *entry);
- void Initialize();
bool CheckSwap();
void SwitchByteSwapCode();
void SetMaxSizeLoadEntry(long);
/// is fixed to 64 bytes.
uint32_t MaxSizePrintEntry;
+
// uint32_t GenerateFreeTagKeyInGroup(uint16_t group);
// void BuildFlatHashTableRecurse( TagDocEntryHT &builtHT,
// DocEntrySet *set );
+
};
} // end namespace gdcm