Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2007/09/17 12:16:02 $
- Version: $Revision: 1.369 $
+ Date: $Date: 2007/10/08 15:20:17 $
+ Version: $Revision: 1.373 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param filetype Type of the File to be written
* (ACR-NEMA, ExplicitVR, ImplicitVR)
*/
-void Document::WriteContent(std::ofstream *fp, FileType filetype)
+void Document::WriteContent(std::ofstream *fp, FileType filetype, bool, bool)
{
// Skip if user wants to write an ACR-NEMA file
vr = entry->GetVR();
//if ( (vr == "OB")||(vr == "OW")||(vr == "UT")||(vr == "SQ"))
- // (no SQ, OW, UT in group 0x0002;)
+ // (no SQ, OW, OL, UT in group 0x0002;)
if ( vr == "OB" )
{
- // explicit VR AND (OB, OW, SQ, UT) : 4 more bytes
+ // explicit VR AND (OB, OW, OL, SQ, UT) : 4 more bytes
groupLength += 4;
}
groupLength += 2 + 2 + 4 + entry->GetLength();
// in the following line.
// (the 'straight' images will no longer be readable ...)
- if ( vr == "OB" || vr == "OW" || vr == "SQ" || vr == "UT"
+ if ( vr == "OB" || vr == "OW" || vr == "OL" || vr == "SQ" || vr == "UT"
|| vr == "UN" || changeFromUN == true)
{
changeFromUN = false;
// "7.1.2 Data element structure with explicit vr", p 27) must be
// skipped before proceeding on reading the length on 4 bytes.
- //Fp->seekg( 2L, std::ios::cur); // Once per OW,OB,SQ DocEntry
- uint32_t length32 = ReadInt32(); // Once per OW,OB,SQ DocEntry
+ //Fp->seekg( 2L, std::ios::cur); // Once per OB,OW,OL,SQ DocEntry
+ uint32_t length32 = ReadInt32(); // Once per Ob,OW,OL,SQ DocEntry
CurrentOffsetPosition+=4;
- if ( (vr == "OB" || vr == "OW") && length32 == 0xffffffff )
+ if ( (vr == "OB" || vr == "OW" || vr == "OL") && length32 == 0xffffffff )
{
uint32_t lengthOB;
try
uint16_t elem;
try
- {
+ { ///\todo make sure there is never OL encoded pixel data!
+
//group = ReadInt16(); // Once per fragment (if any) of OB,OW DataElements
//elem = ReadInt16(); // Once per fragment (if any) of OB,OW DataElements
ReadBegBuffer(4); // Once per fragment (if any) of OB,OW DataElements
}
// Check if next 2 bytes are a VR
// Probabely something more time-consuming exists with std::string
- const char VRvalues[] = "AEASCSDADSFLFDISLOLTPNSHSLSSSTTMUIULUSUTOBOWOFATUNSQ";
- int nbVal = 26;
+ const char VRvalues[] = "AEASATCSDADTFLFDISLOLTPNSHSLSSSTTMUIULUSUTOBOWOLOFATUNSQRT";
+ int nbVal = 29;
const char *pt = VRvalues;
for (int i=0;i<nbVal;i++)
{
- if(*(deb+4) == *pt++)
- if(*(deb+5) == *pt++) {
- Filetype = ExplicitVR;
- return true;
- }
-
+ if(*(deb+4) == *pt++) {
+ if(*(deb+5) == *pt++) {
+ Filetype = ExplicitVR;
+ return true;
+ }
+ else {
+ pt++;
+ }
+ }
}
Filetype = ImplicitVR;
return true;