-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.107 2003/11/03 10:49:31 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.111 2003/11/07 14:34:50 jpr Exp $
#include "gdcmHeader.h"
const char * Transfert = Element->GetValue().c_str();
if ( memcmp(Transfert+strlen(Transfert)-2 ,"70",2)==0) return true;
if ( memcmp(Transfert+strlen(Transfert)-2 ,"55",2)==0) return true;
- if (Element->GetValue() == "1.2.840.10008.1.2.4.57") return true;
+ if (Element->GetValue() == "1.2.840.10008.1.2.4.57") return true;
return false;
}
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)) {
// end of remove area
FoundLength =10;
}
// May be commented out to avoid overhead
else if ( (ElVal->GetGroup() == 0x0009)
&&
- ( (ElVal->GetElement() == 0x1113) || (ElVal->GetElement() == 0x1114) ) )
- FoundLength =4;
-
+ ( (ElVal->GetElement() == 0x1113) || (ElVal->GetElement() == 0x1114) ) ){
+ FoundLength =4;
+ }
+ // end of fix
+
+ // to try to 'go inside' SeQuences (with length), and not to ship them
+ else if ( ElVal->GetVR() == "SQ") {
+ FoundLength =0;
+ }
+
+ // a SeQuence Element is beginning
+ // Let's forget it's length
+ // (we want to 'go inside')
+ else if(ElVal->GetGroup() == 0xfffe){
+ FoundLength =0;
+ }
+
ElVal->SetLength(FoundLength);
}
ElVal->SetLength(FindLengthOB());
return;
}
- FixFoundLength(ElVal, length32);
+ FixFoundLength(ElVal, length32);
+
return;
}
* @return
*/
void gdcmHeader::SkipElementValue(gdcmElValue * ElVal) {
- SkipBytes(ElVal->GetLength());
+ SkipBytes(ElVal->GetLength());
}
/**
// car commencer par les ignorer risque de conduire a qq chose
// qui pourrait ne pas etre generalisable
// Well, I'm expecting your code !!!
+
+ // to try to 'go inside' the SeQuences
+ // we don't any longer skip them !
- if( vr == "SQ" )
- SkipLoad = true;
+ // if( vr == "SQ" )
+ // SkipLoad = true;
// A sequence "contains" a set of Elements.
// (fffe e000) tells us an Element is beginning
rewind(fp);
CheckSwap();
- while ( (newElValue = ReadNextElement()) ) {
+ while ( (newElValue = ReadNextElement()) ) {
SkipElementValue(newElValue);
PubElValSet.Add(newElValue);
}
rewind(fp);
TagElValueHT ht = PubElValSet.GetTagHt();
for (TagElValueHT::iterator tag = ht.begin(); tag != ht.end(); ++tag) {
- LoadElementValue(tag->second);
+ LoadElementValue(tag->second);
}
rewind(fp);
}
// forge the 4 * 8 Bits Red/Green/Blue/Alpha LUT
- char *LUTRGBA = (char *)calloc(1024,1); // 256 * 4 (R, G, B, Alpha)
+ unsigned char *LUTRGBA = (unsigned char *)calloc(1024,1); // 256 * 4 (R, G, B, Alpha)
if (!LUTRGBA) {
return NULL;
}
// and fix the code
// We give up the checking to avoid some overhead
- char *a;
+ unsigned char *a;
int i;
a= LUTRGBA+0;
for(i=0;i<lengthR;i++) {
a+=4;
}
a= LUTRGBA+3;
- for(i=0;i<255;i++) {
+ for(i=0;i<256;i++) {
*a = 1; // Alpha component
a+=4;
}