-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.112 2003/11/10 09:21:40 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.113 2003/11/10 14:17:12 jpr Exp $
#include "gdcmHeader.h"
* applying this heuristic.
*/
void gdcmHeader::FixFoundLength(gdcmElValue * ElVal, guint32 FoundLength) {
+
+ ElVal->SetReadLength(FoundLength); // will be updated only if a bug is found
+
if ( FoundLength == 0xffffffff)
FoundLength = 0;
else if (FoundLength == 13) {
// The following 'if' will be removed when there is no more
// images on Creatis HDs with a 13 length for Manufacturer...
- if ( (ElVal->GetGroup() != 0x0008) || (ElVal->GetElement() != 0x0070)) {
+ if ( (ElVal->GetGroup() != 0x0008) &&
+ ( (ElVal->GetElement() != 0x0070) || (ElVal->GetElement() != 0x0080) ) ) {
// end of remove area
FoundLength =10;
+ ElVal->SetReadLength(10); // a bug is to be fixed
}
}
// to fix some garbage 'Leonardo' Siemens images
else if ( (ElVal->GetGroup() == 0x0009)
&&
( (ElVal->GetElement() == 0x1113) || (ElVal->GetElement() == 0x1114) ) ){
- FoundLength =4;
+ FoundLength =4;
+ ElVal->SetReadLength(4); // a bug is to be fixed
}
// end of fix
FoundLength =0;
}
- ElVal->SetLength(FoundLength);
+ ElVal->SetUsableLength(FoundLength);
}
/**
return;
}
FixFoundLength(ElVal, length32);
-
return;
}
// appear when we find the first group with big endian encoding. This
// is easy to detect since the length of a "Group Length" tag (the
// ones with zero as element number) has to be of 4 (0x0004). When we
- // encouter 1024 (0x0400) chances are the encoding changed and we
+ // encounter 1024 (0x0400) chances are the encoding changed and we
// found a group with big endian encoding.
// We shall use this second strategy. In order to make sure that we
// can interpret the presence of an apparently big endian encoded
// not coexist in a Data Set and Data Sets nested within it".]
// Length is on 4 bytes.
FixFoundLength(ElVal, ReadInt32());
+ return;
}
/**
NewElVal = NewElValueByNumber(g, n);
FindVR(NewElVal);
FindLength(NewElVal);
+
if (errno == 1) {
// Call it quits
return (gdcmElValue *)0;
rewind(fp);
// We don't use any longer the HashTable, since a lot a stuff is missing
- // we SeQuences were encountered
+ // when SeQuences were encountered
//
//TagElValueHT ht = PubElValSet.GetTagHt();
//for (TagElValueHT::iterator tag = ht.begin(); tag != ht.end(); ++tag) {