Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/10/18 21:19:57 $
- Version: $Revision: 1.297 $
+ Date: $Date: 2005/10/23 15:28:26 $
+ Version: $Revision: 1.303 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
void Document::AddForceLoadElement (uint16_t group, uint16_t elem)
{
- Element el;
+ DicomElement el;
el.Group = group;
el.Elem = elem;
UserForceLoadList.push_back(el);
/**
* \brief Loads (from disk) the element content
* when a string is not suitable
- * @param elem Entry whose binArea is going to be loaded
+ * @param entry Entry whose binArea is going to be loaded
*/
void Document::LoadEntryBinArea(DataEntry *entry)
{
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 ) )
{
if ( newDocEntry->GetGroup()%2 != 0 )
{
Fp->seekg( l, std::ios::cur);
- RemoveEntry( newDocEntry ); // Remove and delete
- //used = false; // never used
+ delete newDocEntry; // Delete, not in the set
continue;
}
}
{
// User asked to skip *any* SeQuence
Fp->seekg( l, std::ios::cur);
- //used = false; // never used
- RemoveEntry( newDocEntry ); // Remove and delete
+ delete newDocEntry; // Delete, not in the set
continue;
}
// delay the dynamic cast as late as possible
// is a Document, then we are building the first depth level.
// Hence the SeqEntry we are building simply has a depth
// level of one:
-// SQItem *parentSQItem = dynamic_cast< SQItem* > ( set );
if ( set == this ) // ( dynamic_cast< Document* > ( set ) )
{
newSeqEntry->SetDepthLevel( 1 );
- // newSeqEntry->SetKey( newSeqEntry->GetKey() );
}
// But when "set" is already a SQItem, we are building a nested
// sequence, and hence the depth level of the new SeqEntry
else if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) )
{
newSeqEntry->SetDepthLevel( parentSQItem->GetDepthLevel() + 1 );
-
- // newSeqEntry->SetKey( parentSQItem->GetBaseTagKey()
- // + newSeqEntry->GetKey() );
}
if ( l != 0 )
}
else
{
- // Allthough this should never happen, still some images have a
+ // Although this should never happen, still some images have a
// corrupted group length [e.g. have a glance at offset x(8336) of
- // gdcmData/gdcm-MR-PHILIPS-16-Multi-Seq.dcm].
+ // gdcmData/gdcm-MR-PHILIPS-16-Multi-Seq.dcm.
// Since for dicom compliant and well behaved headers, the present
// test is useless (and might even look a bit paranoid), when we
// encounter such an ill-formed image, we simply display a warning
*/
void Document::SwitchByteSwapCode()
{
- gdcmWarningMacro( "Switching Byte Swap code from "<< SwapCode
- << " at :" <<std::hex << Fp->tellg() );
+ gdcmDebugMacro( "Switching Byte Swap code from "<< SwapCode
+ << " at: 0x" << std::hex << Fp->tellg() );
if ( SwapCode == 1234 )
{
SwapCode = 4321;
{
SwapCode = 3412;
}
+ gdcmDebugMacro( " Into: "<< SwapCode );
}
/**
if ( dictEntry )
{
realVR = dictEntry->GetVR();
+ dictEntry->Unregister();
}
}
}