Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/11/25 10:24:34 $
- Version: $Revision: 1.138 $
+ Date: $Date: 2004/11/25 16:35:16 $
+ Version: $Revision: 1.141 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
+//-----------------------------------------------------------------------------
static const char *TransferSyntaxStrings[] = {
// Implicit VR Little Endian
"1.2.840.10008.1.2",
// Unknown
"Unknown Transfer Syntax"
};
-
+
//-----------------------------------------------------------------------------
// Refer to Document::CheckSwap()
const unsigned int Document::HEADER_LENGTH_TO_READ = 256;
* (ACR-NEMA, ExplicitVR, ImplicitVR)
* \return Always true.
*/
-void Document::Write(std::ofstream* fp, FileType filetype)
+void Document::WriteContent(std::ofstream* fp, FileType filetype)
{
/// \todo move the following lines (and a lot of others, to be written)
/// to a future function CheckAndCorrectHeader
fp->write("DICM", 4);
}
- if (filetype == ImplicitVR)
- {
- std::string ts =
- Util::DicomString( TransferSyntaxStrings[ImplicitVRLittleEndian] );
- ReplaceOrCreateByNumber(ts, 0x0002, 0x0010);
-
- /// \todo Refer to standards on page 21, chapter 6.2
- /// "Value representation": values with a VR of UI shall be
- /// padded with a single trailing null
- /// in the following case we have to padd manually with a 0
-
- SetEntryLengthByNumber(18, 0x0002, 0x0010);
- }
-
- if (filetype == ExplicitVR)
- {
- std::string ts =
- Util::DicomString( TransferSyntaxStrings[ExplicitVRLittleEndian] );
- ReplaceOrCreateByNumber(ts, 0x0002, 0x0010); //LEAK
-
- /// \todo Refer to standards on page 21, chapter 6.2
- /// "Value representation": values with a VR of UI shall be
- /// padded with a single trailing null
- /// Dans le cas suivant on doit pader manuellement avec un 0
-
- SetEntryLengthByNumber(20, 0x0002, 0x0010);
- }
-
/**
* \todo rewrite later, if really usefull
* - 'Group Length' element is optional in DICOM
* UpdateGroupLength(true,ACR);
*/
- ElementSet::Write(fp, filetype); // This one is recursive
-
+ ElementSet::WriteContent(fp, filetype); // This one is recursive
}
/**
return true;
}
+std::string Document::GetTransferSyntaxValue(TransferSyntaxType type)
+{
+ return TransferSyntaxStrings[type];
+}
+
//-----------------------------------------------------------------------------
// Protected
}
//////////////////// BinEntry or UNKOWN VR:
-/* BinEntry* newBinEntry =
- new BinEntry( newDocEntry->GetDictEntry() ); //LEAK
- newBinEntry->Copy( newDocEntry );*/
BinEntry* newBinEntry = new BinEntry( newDocEntry ); //LEAK
// When "this" is a Document the Key is simply of the
// representation of a 32 bits integer. Hence the following dirty
// trick :
s32 = *((uint32_t *)(entCur));
-
+
switch( s32 )
{
case 0x00040000 :