0002|0000. The value was incorrect.
-- BeNours
+2005-01-28 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmFile.cxx, gdcmDocument.cxx : fix the bug on the group|element
+ 0002|0000. The value was incorrect.
+
2005-01-28 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* vtk/vtkGdcmWriter.[h|cxx] : add the gestion of UID
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 09:31:51 $
- Version: $Revision: 1.215 $
+ Date: $Date: 2005/01/28 10:34:28 $
+ Version: $Revision: 1.216 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// for each zero-level Tag in the DCM Header
DocEntry *entry = GetFirstEntry();
- while(entry)
+ while( entry )
{
gr = entry->GetGroup();
- if (gr == 0x0002)
+ if( gr == 0x0002 )
{
found0002 = true;
- vr = entry->GetVR();
-
- if (filetype == ExplicitVR)
+
+ if( entry->GetElement() != 0x0000 )
{
- if ( (vr == "OB") || (vr == "OW") || (vr == "SQ") )
+ vr = entry->GetVR();
+
+ if( filetype == ExplicitVR )
{
- groupLength += 4; // explicit VR AND OB, OW, SQ : 4 more bytes
+ if ( (vr == "OB") || (vr == "OW") || (vr == "SQ") )
+ {
+ // explicit VR AND OB, OW, SQ : 4 more bytes
+ groupLength += 4;
+ }
}
+ groupLength += 2 + 2 + 4 + entry->GetLength();
}
- groupLength += 2 + 2 + 4 + entry->GetLength();
}
else if (found0002 )
break;
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 09:37:29 $
- Version: $Revision: 1.203 $
+ Date: $Date: 2005/01/28 10:34:28 $
+ Version: $Revision: 1.204 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return false;
}
+ // Entry : 0002|0000 = group length -> recalculated
+ ValEntry *e0002 = GetValEntry(0x0002,0x0000);
+ if( e0002 )
+ {
+ std::ostringstream sLen;
+ sLen << ComputeGroup0002Length(filetype);
+ e0002->SetValue(sLen.str());
+ }
+
// Bits Allocated
if ( GetEntryValue(0x0028,0x0100) == "12")
{
SetValEntry("16", 0x0028,0x0100);
}
- /// \todo correct 'Pixel group' Length if necessary
-
int i_lgPix = GetEntryLength(GrPixel, NumPixel);
if (i_lgPix != -2)
{
// (or in future gdcmPixelData class)
// Drop Palette Color, if necessary
-
if ( GetEntryValue(0x0028,0x0002).c_str()[0] == '3' )
{
// if SamplesPerPixel = 3, sure we don't need any LUT !