Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2006/04/11 16:03:26 $
- Version: $Revision: 1.346 $
+ Date: $Date: 2006/05/30 08:10:19 $
+ Version: $Revision: 1.349 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return DoTheLoadingDocumentJob( );
}
-#ifndef GDCM_LEGACY_REMOVE
+
+//#ifndef GDCM_LEGACY_REMOVE
/**
* \brief Loader. (DEPRECATED : not to break the API)
* @param fileName 'Document' (File or DicomDir) to be open for parsing
* @return false if file cannot be open or no swap info was found,
* or no tag was found.
*/
+ /*
bool Document::Load( std::string const &fileName )
{
Filename = fileName;
return DoTheLoadingDocumentJob( );
}
-#endif
+*/
+//#endif
/**
* \brief Performs the Loading Job (internal use only)
LoadDocEntry(d, true);
}
- CloseFile();
+ CloseFile();
// ----------------------------
// Specific code to allow gdcm to read ACR-LibIDO formated images
DocEntry *newDocEntry;
DataEntry *newDataEntry;
SeqEntry *newSeqEntry;
- VRKey vr;
+ //VRKey vr;
bool used; // will be set to false when something wrong happens to an Entry.
// (Entry will then be deleted)
bool delim_mode_intern = delim_mode;
if( Debug::GetDebugFlag() )
std::cout << std::dec <<"(long)(Fp->tellg()) " << (long)(Fp->tellg()) // in Debug mode
<< std::hex << " 0x(" <<(long)(Fp->tellg()) << ")" << std::endl;
-*/
+ */
// if ( !delim_mode && ((long)(Fp->tellg())-offset) >= l_max) // Once per DocEntry
if ( !delim_mode ) // 'and then' doesn't exist in C++ :-(
{
break;
}
- newDocEntry = ReadNextDocEntry( );
- // Uncoment this cerr line to be able to 'follow' the DocEntries
- // when something *very* strange happens
- if( Debug::GetDebugFlag() )
- std::cerr<<newDocEntry->GetKey()<<" "<<newDocEntry->GetVR()<<std::endl;
+ newDocEntry = ReadNextDocEntry( );
if ( !newDocEntry )
{
break;
}
+
+ // Uncoment this cerr line to be able to 'follow' the DocEntries
+ // when something *very* strange happens
+ if( Debug::GetDebugFlag() )
+ std::cerr<<newDocEntry->GetKey()<<" "<<newDocEntry->GetVR()<<std::endl;
- // an Item Starter found elsewhere but the first position
+ // an Item Starter found elsewhere but in the first position
// of a SeqEntry means previous entry was a Sequence
// but we didn't get it (private Sequence + Implicit VR)
// we have to backtrack.
{
//////////////////////////// DataEntry
- vr = newDocEntry->GetVR();
+ //vr = newDocEntry->GetVR(); // useless ?
if ( !set->AddEntry( newDataEntry ) )
{
*/
void Document::LoadDocEntry(DocEntry *entry, bool forceLoad)
{
- uint16_t group = entry->GetGroup();
- uint16_t elem = entry->GetElement();
+ uint16_t group = entry->GetGroup();
+ uint16_t elem = entry->GetElement();
const VRKey &vr = entry->GetVR();
- uint32_t length = entry->GetLength();
+ uint32_t length = entry->GetLength();
// Fp->seekg((long)entry->GetOffset(), std::ios::beg); // JPRx
gdcmErrorMacro( "This looks like to a buggy Siemens DICOM file."
"The length of this tag seems to be wrong" );
}
- }
-
+ }
+
else if ( entry->GetVR() == "SQ" )
{
- foundLength = 0; // ReadLength is unchanged
- }
-
- //////// We encountered a 'delimiter' element i.e. a tag of the form
+ foundLength = 0; // ReadLength is unchanged
+ }
+
+ //////// We encountered a 'delimiter' element i.e. a tag of the form
// "fffe|xxxx" which is just a marker. Delimiters length should not be
// taken into account.
else if ( gr == 0xfffe )
- {
+ {
// According to the norm, fffe|0000 shouldn't exist. BUT the Philips
// image gdcmData/gdcm-MR-PHILIPS-16-Multi-Seq.dcm happens to
// causes extra troubles...
{
foundLength=12; // to skip the mess that follows this bugged Tag !
}
- }
+ }
entry->SetLength(foundLength);
}
// encounter such an ill-formed image, we simply display a warning
// message and proceed on parsing (while crossing fingers).
long filePosition = Fp->tellg(); // Only when elem 0x0000 length is not 4 (?!?)
+ (void)filePosition;
gdcmWarningMacro( "Erroneous Group Length element length on : ("
<< std::hex << group << " , " << elem
<< ") -before- position x(" << filePosition << ")"