Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/10/21 07:38:58 $
- Version: $Revision: 1.302 $
+ Date: $Date: 2005/10/25 14:52:34 $
+ Version: $Revision: 1.307 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return;
}
- // Read the datas
+ // Read the data
Fp->read((char*)data, l);
if ( Fp->fail() || Fp->eof() )
{
}
case 8:
{
- gdcmWarningMacro("Can't swap 64 bits datas");
+ gdcmWarningMacro("Can't swap 64 bits data");
/* uint64_t *data64 = (uint64_t *)data;
for(i=0;i<l/vrLgth;i++)
data64[i] = SwapLongLong(data64[i]);*/
// (no SQ, OW, UT in group 0x0002;)
if ( vr == "OB" )
{
- // explicit VR AND OB, OW, SQ, UT : 4 more bytes
+ // explicit VR AND (OB, OW, SQ, UT) : 4 more bytes
groupLength += 4;
}
//}
if ( newDataEntry )
{
//////////////////////////// DataEntry
+
vr = newDocEntry->GetVR();
+
+ // Useless checking, now !
+ /*
if ( Filetype == ExplicitVR &&
!Global::GetVR()->IsVROfBinaryRepresentable(vr) )
{
////// No DataEntry: should mean UNKOWN VR
gdcmWarningMacro( std::hex << newDocEntry->GetGroup()
<< "|" << newDocEntry->GetElement()
- << " : No DataEntry."
- "Probably unknown VR.");
+ << " : unknown VR."
+ " Probably 'Implicit VR' entry within "
+ "an explicit VR 'document'.");
}
+ */
if ( !set->AddEntry( newDataEntry ) )
{
}
else
{
+ newDataEntry->Delete();
// Load only if we can add (not a duplicate key)
LoadDocEntry( newDataEntry );
}
(!delim_mode && ((long)(Fp->tellg())-offset) >= l_max) )
{
if ( !used )
- delete newDocEntry;
+ newDocEntry->Delete();
break;
}
if ( newDocEntry->GetGroup()%2 != 0 )
{
Fp->seekg( l, std::ios::cur);
- delete newDocEntry; // Delete, not in the set
+ newDocEntry->Delete(); // Delete, not in the set
continue;
}
}
{
// User asked to skip *any* SeQuence
Fp->seekg( l, std::ios::cur);
- delete newDocEntry; // Delete, not in the set
+ newDocEntry->Delete(); // Delete, not in the set
continue;
}
// delay the dynamic cast as late as possible
<< newSeqEntry->GetOffset() << " )" );
used = false;
}
+ else
+ {
+ newDocEntry->Delete();
+ }
if ( !delim_mode && ((long)(Fp->tellg())-offset) >= l_max)
{
if ( !used )
- delete newDocEntry;
- break;
+ newDocEntry->Delete();
+ break;
}
} // end SeqEntry : VR = "SQ"
if ( !used )
{
- delete newDocEntry;
+ newDocEntry->Delete();
}
first = false;
} // end While
if ( newDocEntry->IsSequenceDelimitor() )
{
seqEntry->SetDelimitationItem( newDocEntry );
+ newDocEntry->Delete();
break;
}
}
if ( !delim_mode && ((long)(Fp->tellg())-offset) >= l_max)
{
- delete newDocEntry;
+ newDocEntry->Delete();
break;
}
// create the current SQItem
- SQItem *itemSQ = new SQItem( seqEntry->GetDepthLevel() );
+ SQItem *itemSQ = SQItem::New( seqEntry->GetDepthLevel() );
unsigned int l = newDocEntry->GetReadLength();
if ( l == 0xffffffff )
// Let's try :------------
// remove fff0,e000, created out of the SQItem
- delete newDocEntry;
Fp->seekg(offsetStartCurrentSQItem, std::ios::beg);
// fill up the current SQItem, starting at the beginning of fff0,e000
// end try -----------------
seqEntry->AddSQItem( itemSQ, SQItemNumber );
+ itemSQ->Delete();
+ newDocEntry->Delete();
SQItemNumber++;
if ( !delim_mode && ((long)(Fp->tellg())-offset ) >= l_max )
{
{
// delete the Item Starter, built erroneously out of any Sequence
// it's not yet in the HTable/chained list
- delete docEntry;
+ docEntry->Delete();
// Get all info we can from PreviousDocEntry
uint16_t group = PreviousDocEntry->GetGroup();
}
}
}
- gdcmDebugMacro( "Found VR: " << vr << " / Real VR: " << realVR );
+ // gdcmDebugMacro( "Found VR: " << vr << " / Real VR: " << realVR );
DocEntry *newEntry;
if ( Global::GetVR()->IsVROfSequence(realVR) )
catch ( FormatError )
{
// Call it quits
- delete newEntry;
+ newEntry->Delete();
return 0;
}