Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/11/25 13:12:02 $
- Version: $Revision: 1.139 $
+ Date: $Date: 2004/11/26 10:55:04 $
+ Version: $Revision: 1.142 $
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",
+ // Implicit VR Little Endian DLX G.E?
+ "1.2.840.113619.5.2",
+ // Explicit VR Little Endian
+ "1.2.840.10008.1.2.1",
+ // Deflated Explicit VR Little Endian
+ "1.2.840.10008.1.2.1.99",
+ // Explicit VR Big Endian
+ "1.2.840.10008.1.2.2",
+ // JPEG Baseline (Process 1)
+ "1.2.840.10008.1.2.4.50",
+ // JPEG Extended (Process 2 & 4)
+ "1.2.840.10008.1.2.4.51",
+ // JPEG Extended (Process 3 & 5)
+ "1.2.840.10008.1.2.4.52",
+ // JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8)
+ "1.2.840.10008.1.2.4.53",
+ // JPEG Full Progression, Non-Hierarchical (Process 10 & 12)
+ "1.2.840.10008.1.2.4.55",
+ // JPEG Lossless, Non-Hierarchical (Process 14)
+ "1.2.840.10008.1.2.4.57",
+ // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1])
+ "1.2.840.10008.1.2.4.70",
+ // JPEG 2000 Lossless
+ "1.2.840.10008.1.2.4.90",
+ // JPEG 2000
+ "1.2.840.10008.1.2.4.91",
+ // RLE Lossless
+ "1.2.840.10008.1.2.5",
+ // 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
* 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
* @param element element number of the Entry to modify
* @return true on success, false otherwise.
*/
-bool Document::SetEntryLengthByNumber(uint32_t l,
+/*bool Document::SetEntryLengthByNumber(uint32_t l,
uint16_t group, uint16_t element)
{
/// \todo use map methods, instead of multimap JPR
( ((TagHT.equal_range(key)).first)->second )->SetLength(l);
return true ;
-}
+}*/
/**
* \brief Gets (from Header) the offset of a 'non string' element value
* @param elem element number of the Entry
* @return File Offset of the Element Value
*/
-size_t Document::GetEntryOffsetByNumber(uint16_t group, uint16_t elem)
+/*size_t Document::GetEntryOffsetByNumber(uint16_t group, uint16_t elem)
{
DocEntry* entry = GetDocEntryByNumber(group, elem);
if (!entry)
return 0;
}
return entry->GetOffset();
-}
+}*/
/**
* \brief Gets (from Header) a 'non string' element value
return;
LoadEntryBinArea(binElement);
-/* size_t o =(size_t)docElement->GetOffset();
- Fp->seekg( o, std::ios_base::beg);
- size_t l = docElement->GetLength();
- uint8_t* a = new uint8_t[l];
- if(!a)
- {
- dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
- return;
- }
-
- // Read the value
- Fp->read((char*)a, l);
- if( Fp->fail() || Fp->eof() )//Fp->gcount() == 1
- {
- delete[] a;
- return;
- }
-
- // Set the value to the DocEntry
- if( !SetEntryBinAreaByNumber( a, group, elem ) )
- {
- delete[] a;
- dbg.Verbose(0, "Document::LoadEntryBinArea setting failed.");
- }*/
}
/**
* @param element Element number of the searched Dicom Element
* @return
*/
-bool Document::SetEntryBinAreaByNumber(uint8_t* area,
+/*bool Document::SetEntryBinAreaByNumber(uint8_t* area,
uint16_t group, uint16_t element)
{
DocEntry* currentEntry = GetDocEntryByNumber(group, element);
}
return false;
-}
+}*/
/**
* \brief Update the entries with the shadow dictionary.