Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 21:09:42 $
- Version: $Revision: 1.95 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.96 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// if user passed a root directory, sure we didn't get anything
if ( TagHT.begin() == TagHT.end() ) // when user passed a Directory to parse
{
- gdcmVerboseMacro("DicomDir::DicomDir : entry HT empty");
+ gdcmVerboseMacro( "Entry HT empty");
if ( fileName == "." )
{
{
MetaElems = NewMeta();
- gdcmVerboseMacro("DicomDir::DicomDir : Parse directory"
- " and create the DicomDir");
+ gdcmVerboseMacro( "Parse directory and create the DicomDir");
ParseDirectory();
}
else
DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220);
if ( !e )
{
- gdcmVerboseMacro("DicomDir::DicomDir : NO Directory record"
- " sequence (0x0004,0x1220)");
+ gdcmVerboseMacro( "NO Directory record sequence (0x0004,0x1220)");
/// \todo FIXME : what do we do when the parsed file IS NOT a
/// DICOMDIR file ?
}
header = new Header( it->c_str() );
if( !header )
{
- gdcmVerboseMacro( "DicomDir::CreateDicomDirChainedList: " <<
- "failure in new Header " <<
- it->c_str() );
+ gdcmVerboseMacro( "Failure in new Header " << it->c_str() );
continue;
}
{
// Add the file header to the chained list:
list.push_back(header);
- gdcmVerboseMacro( "DicomDir::CreateDicomDirChainedList: readable " <<
- it->c_str() );
+ gdcmVerboseMacro( "Readable " << it->c_str() );
}
else
{
si = new DicomDirImage();
if( !AddDicomDirImageToEnd(static_cast<DicomDirImage *>(si)) )
{
- gdcmVerboseMacro("DicomDir::SetElement:"
- "Add DicomDirImageToEnd failed");
+ gdcmVerboseMacro( "Add DicomDirImageToEnd failed");
}
break;
case GDCM_DICOMDIR_SERIE:
si = new DicomDirSerie();
if( !AddDicomDirSerieToEnd(static_cast<DicomDirSerie *>(si)) )
{
- gdcmVerboseMacro("DicomDir::SetElement:"
- "Add DicomDirSerieToEnd failed");
+ gdcmVerboseMacro( "Add DicomDirSerieToEnd failed");
}
break;
case GDCM_DICOMDIR_STUDY:
si = new DicomDirStudy();
if( !AddDicomDirStudyToEnd(static_cast<DicomDirStudy *>(si)) )
{
- gdcmVerboseMacro("DicomDir::SetElement:"
- "Add DicomDirStudyToEnd failed");
+ gdcmVerboseMacro( "Add DicomDirStudyToEnd failed");
}
break;
case GDCM_DICOMDIR_PATIENT:
si = new DicomDirPatient();
if( !AddDicomDirPatientToEnd(static_cast<DicomDirPatient *>(si)) )
{
- gdcmVerboseMacro("DicomDir::SetElement:"
- "Add DicomDirPatientToEnd failed");
+ gdcmVerboseMacro( "Add DicomDirPatientToEnd failed");
}
break;
case GDCM_DICOMDIR_META:
si = new DicomDirMeta();
if( MetaElems )
{
- gdcmVerboseMacro("DicomDir::SetElement:"
- "MetaElements already exist, they will be destroyed");
+ gdcmVerboseMacro( "MetaElements already exist, they will be destroyed");
delete MetaElems;
}
MetaElems = static_cast<DicomDirMeta *>(si);
{
if( header->GetFileName().substr(0, path.length()) != path )
{
- gdcmVerboseMacro("DicomDir::SetElement : the base path"
- " of file name is incorrect");
+ gdcmVerboseMacro( "The base path of file name is incorrect");
val = header->GetFileName();
}
else
DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220);
if ( !e )
{
- gdcmVerboseMacro("DicomDir::DicomDir : NO Directory record"
- " sequence (0x0004,0x1220)");
+ gdcmVerboseMacro( "NO Directory record sequence (0x0004,0x1220)");
/// \todo FIXME: what to do when the parsed file IS NOT a DICOMDIR file ?
return;
}
SeqEntry *s = dynamic_cast<SeqEntry *>(e);
if ( !s )
{
- gdcmVerboseMacro("DicomDir::CreateDicomDir: no SeqEntry present");
+ gdcmVerboseMacro( "No SeqEntry present");
// useless : (0x0004,0x1220) IS a Sequence !
return;
}
}
else
{
- gdcmVerboseMacro("DicomDir::CreateDicomDir: not a ValEntry.");
+ gdcmVerboseMacro( "Not a ValEntry.");
continue;
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ifstream from(filename.c_str());
if(!from)
{
- gdcmVerboseMacro( "DicomDirElement::DicomDirElement: can't open dictionary"
- << filename.c_str());
+ gdcmVerboseMacro( "Can't open dictionary" << filename.c_str());
FillDefaultDIRDict( this );
}
else
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.59 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.60 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ifstream from( filename.c_str() );
if( !from )
{
- gdcmVerboseMacro("Dict::Dict: can't open dictionary" << filename.c_str());
+ gdcmVerboseMacro( "Can't open dictionary" << filename.c_str());
// Using default embeded one:
FillDefaultDataDict( this );
}
if(KeyHt.count(key) == 1)
{
- gdcmVerboseMacro("Dict::AddNewEntry already present" << key.c_str());
+ gdcmVerboseMacro( "Already present" << key.c_str());
return false;
}
else
}
else
{
- gdcmVerboseMacro("Dict::RemoveEntry unfound entry" << key.c_str());
+ gdcmVerboseMacro( "Unfound entry" << key.c_str());
return false;
}
}
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.48 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.49 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
resultPath += '/';
}
- gdcmVerboseMacro("DictSet::BuildDictPath:"
- "Dictionary path set from environnement");
+ gdcmVerboseMacro( "Dictionary path set from environnement");
}
else
{
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.37 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
ValEntry *newEntry = new ValEntry(dictEntry);
if (!newEntry)
{
- gdcmVerboseMacro("Document::NewValEntryByNumber"
- "failed to allocate ValEntry");
+ gdcmVerboseMacro( "Failed to allocate ValEntry");
return 0;
}
return newEntry;
BinEntry *newEntry = new BinEntry(dictEntry);
if (!newEntry)
{
- gdcmVerboseMacro("Document::NewBinEntryByNumber"
- "failed to allocate BinEntry");
+ gdcmVerboseMacro( "Failed to allocate BinEntry");
return 0;
}
return newEntry;
SeqEntry *newEntry = new SeqEntry( dictEntry );
if (!newEntry)
{
- gdcmVerboseMacro("Document::NewSeqEntryByNumber"
- "failed to allocate SeqEntry");
+ gdcmVerboseMacro( "Failed to allocate SeqEntry");
return 0;
}
return newEntry;
Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
if (!pubDict)
{
- gdcmVerboseMacro("Document::GetDictEntry"
- "we SHOULD have a default dictionary");
+ gdcmVerboseMacro( "We SHOULD have a default dictionary");
}
else
{
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.165 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.166 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return;
}
- gdcmVerboseMacro("Document::Document: starting parsing of file: " <<
- Filename.c_str());
+ gdcmVerboseMacro( "Starting parsing of file: " << Filename.c_str());
Fp->seekg( 0, std::ios::beg);
Fp->seekg(0, std::ios::end);
{
if( Filetype == Unknown)
{
- gdcmVerboseMacro("Document::IsReadable: wrong filetype");
+ gdcmVerboseMacro( "Wrong filetype");
return false;
}
if( TagHT.empty() )
{
- gdcmVerboseMacro("Document::IsReadable: no tags in internal"
- " hash table.");
+ gdcmVerboseMacro( "No tags in internal hash table.");
return false;
}
if(Fp)
{
- gdcmVerboseMacro( "Document::OpenFile is already opened when opening: " <<
- Filename.c_str());
+ gdcmVerboseMacro( "Is already opened when opening: " << Filename.c_str());
}
Fp = new std::ifstream(Filename.c_str(), std::ios::in | std::ios::binary);
if( ! *Fp )
{
- gdcmVerboseMacro( "Document::OpenFile cannot open file: " <<
- Filename.c_str());
+ gdcmVerboseMacro( "Cannot open file: " << Filename.c_str());
delete Fp;
Fp = 0;
return 0;
}
CloseFile();
- gdcmVerboseMacro( "Document::OpenFile not DICOM/ACR (missing preamble)" <<
- Filename.c_str());
+ gdcmVerboseMacro( "Not DICOM/ACR (missing preamble)" << Filename.c_str());
return 0;
}
{
if (!RemoveEntry(currentEntry))
{
- gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal"
- " of previous DocEntry failed.");
+ gdcmVerboseMacro( "Removal of previous DocEntry failed.");
return NULL;
}
if ( !AddEntry(valEntry))
{
- gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry"
- " failed allthough this is a creation.");
+ gdcmVerboseMacro("AddEntry failed although this is a creation.");
delete valEntry;
return NULL;
{
if (!RemoveEntry(currentEntry))
{
- gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal"
- " of previous DocEntry failed.");
+ gdcmVerboseMacro( "Removal of previous DocEntry failed.");
return NULL;
}
if ( !AddEntry(binEntry))
{
- gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry"
- " failed allthough this is a creation.");
+ gdcmVerboseMacro( "AddEntry failed allthough this is a creation.");
delete binEntry;
return NULL;
{
if (!RemoveEntry(currentEntry))
{
- gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal"
- " of previous DocEntry failed.");
+ gdcmVerboseMacro( "Removal of previous DocEntry failed.");
return NULL;
}
if ( !AddEntry(seqEntry))
{
- gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry"
- " failed allthough this is a creation.");
+ gdcmVerboseMacro( "AddEntry failed allthough this is a creation.");
delete seqEntry;
return NULL;
ValEntry *entry = GetValEntryByNumber(group, element);
if (!entry )
{
- gdcmVerboseMacro("Document::SetEntryByNumber: no corresponding"
- " ValEntry (try promotion first).");
+ gdcmVerboseMacro( "No corresponding ValEntry (try promotion first).");
return false;
}
return SetEntry(content,entry);
BinEntry *entry = GetBinEntryByNumber(group, element);
if (!entry )
{
- gdcmVerboseMacro( "Document::SetEntryByNumber: no corresponding"
- " ValEntry (try promotion first).");
+ gdcmVerboseMacro( "No corresponding ValEntry (try promotion first).");
return false;
}
DocEntry *entry = GetDocEntryByNumber(group, elem);
if (!entry)
{
- gdcmVerboseMacro("Document::GetDocEntryByNumber: no entry");
+ gdcmVerboseMacro( "No entry");
return 0;
}
if ( BinEntry *binEntry = dynamic_cast<BinEntry*>(entry) )
uint8_t *a = new uint8_t[l];
if( !a )
{
- gdcmVerboseMacro("Document::LoadEntryBinArea cannot allocate a");
+ gdcmVerboseMacro( "Cannot allocate a");
return;
}
{
return entry;
}
- gdcmVerboseMacro("Document::GetValEntryByNumber: unfound ValEntry.");
+ gdcmVerboseMacro( "Unfound ValEntry.");
return 0;
}
{
return entry;
}
- gdcmVerboseMacro("Document::GetBinEntryByNumber: unfound BinEntry.");
+ gdcmVerboseMacro( "Unfound BinEntry.");
return 0;
}
if ( ! Global::GetVR()->IsVROfBinaryRepresentable(vr) )
{
////// Neither ValEntry NOR BinEntry: should mean UNKOWN VR
- gdcmVerboseMacro("Document::ParseDES: neither Valentry, "
- "nor BinEntry. Probably unknown VR.");
+ gdcmVerboseMacro( "Neither Valentry, nor BinEntry."
+ "Probably unknown VR.");
}
//////////////////// BinEntry or UNKOWN VR:
{
if ( Fp->fail() || Fp->eof())//Fp->gcount() == 1
{
- gdcmVerboseMacro("Document::LoadDocEntry"
- "unread element value");
+ gdcmVerboseMacro( "Unread element value");
valEntry->SetValue(GDCM_UNREAD);
return;
}
if ( foundLength % 2)
{
- std::ostringstream s;
- s << "Warning : Tag with uneven length "
- << foundLength
- << " in x(" << std::hex << gr << "," << elem <<")" << std::dec;
- gdcmVerboseMacro(s.str().c_str());
+ gdcmVerboseMacro( "Warning : Tag with uneven length " << foundLength
+ << " in x(" << std::hex << gr << "," << elem <<")");
}
//////// Fix for some naughty General Electric images.
// test is useless (and might even look a bit paranoid), when we
// encounter such an ill-formed image, we simply display a warning
// message and proceed on parsing (while crossing fingers).
- std::ostringstream s;
long filePosition = Fp->tellg();
- s << "Erroneous Group Length element length on : (" \
+ gdcmVerboseMacro( "Erroneous Group Length element length on : ("
<< std::hex << group << " , " << element
<< ") -before- position x(" << filePosition << ")"
- << "lgt : " << length;
- gdcmVerboseMacro("Document::IsDocEntryAnInteger" << s.str().c_str() );
+ << "lgt : " << length );
}
}
if ( group != 0xfffe || ( ( elem != 0xe0dd ) && ( elem != 0xe000 ) ) )
{
- gdcmVerboseMacro("Document::FindDocEntryLengthOBOrOW: neither an Item "
- "tag nor a Sequence delimiter tag.");
+ gdcmVerboseMacro( "Neither an Item tag nor a Sequence delimiter tag.");
Fp->seekg(positionOnEntry, std::ios::beg);
- throw FormatUnexpected("Document::FindDocEntryLengthOBOrOW()",
- "Neither an Item tag nor a Sequence "
- "delimiter tag.");
+ throw FormatUnexpected( "Neither an Item tag nor a Sequence delimiter tag.");
}
if ( elem == 0xe0dd )
char *entCur = deb + 128;
if( memcmp(entCur, "DICM", (size_t)4) == 0 )
{
- gdcmVerboseMacro("Document::CheckSwap:" "looks like DICOM Version3");
+ gdcmVerboseMacro( "Looks like DICOM Version3" );
// Next, determine the value representation (VR). Let's skip to the
// first element (0002, 0000) and check there if we find "UL"
// instead of just checking for UL, OB and UI !? group 0000
{
Filetype = ExplicitVR;
- gdcmVerboseMacro( "Document::CheckSwap:"
- "explicit Value Representation");
+ gdcmVerboseMacro( "Explicit Value Representation");
}
else
{
Filetype = ImplicitVR;
- gdcmVerboseMacro("Document::CheckSwap:"
- "not an explicit Value Representation");
+ gdcmVerboseMacro( "Not an explicit Value Representation");
}
if ( net2host )
{
SwapCode = 4321;
- gdcmVerboseMacro("Document::CheckSwap:"
- "HostByteOrder != NetworkByteOrder");
+ gdcmVerboseMacro( "HostByteOrder != NetworkByteOrder");
}
else
{
SwapCode = 0;
- gdcmVerboseMacro("Document::CheckSwap:"
- "HostByteOrder = NetworkByteOrder");
+ gdcmVerboseMacro( "HostByteOrder = NetworkByteOrder");
}
// Position the file position indicator at first tag (i.e.
// Alas, this is not a DicomV3 file and whatever happens there is no file
// preamble. We can reset the file position indicator to where the data
// is (i.e. the beginning of the file).
- gdcmVerboseMacro("Document::CheckSwap:" "not a DICOM Version3 file");
+ gdcmVerboseMacro( "Not a DICOM Version3 file");
Fp->seekg(0, std::ios::beg);
// Our next best chance would be to be considering a 'clean' ACR/NEMA file.
Filetype = ACR;
return true;
default :
- gdcmVerboseMacro( "Document::CheckSwap:"
- "ACR/NEMA unfound swap info (Really hopeless !)");
+ gdcmVerboseMacro( "ACR/NEMA unfound swap info (Really hopeless !)");
Filetype = Unknown;
return false;
}
*/
void Document::SwitchSwapToBigEndian()
{
- gdcmVerboseMacro("Document::SwitchSwapToBigEndian"
- "Switching to BigEndian mode.");
+ gdcmVerboseMacro( "Switching to BigEndian mode.");
if ( SwapCode == 0 )
{
SwapCode = 4321;
std::string msg;
msg = Util::Format("Falsely explicit vr file (%04x,%04x)\n",
newEntry->GetGroup(), newEntry->GetElement());
- gdcmVerboseMacro("Document::FindVR: " << msg.c_str());
+ gdcmVerboseMacro( msg.c_str() );
}
newEntry->SetImplicitVR();
}
}
if ( itemTagGroup != testGroup || itemTagElement != testElement )
{
- std::ostringstream s;
- s << " We should have found tag (";
- s << std::hex << testGroup << "," << testElement << ")" << std::endl;
- s << " but instead we encountered tag (";
- s << std::hex << itemTagGroup << "," << itemTagElement << ")"
- << std::endl;
- s << " at address: " << (unsigned)currentPosition << std::endl;
- gdcmVerboseMacro("Document::ReadItemTagLength: wrong Item Tag found:"
- << s.str().c_str());
+ gdcmVerboseMacro( "Wrong Item Tag found:"
+ << " We should have found tag ("
+ << std::hex << testGroup << "," << testElement << ")" << std::endl
+ << " but instead we encountered tag ("
+ << std::hex << itemTagGroup << "," << itemTagElement << ")"
+ << std::endl
+ << " at address: " << (unsigned int)currentPosition );
Fp->seekg(positionOnEntry, std::ios::beg);
return false;
long currentPosition = Fp->tellg();
uint32_t itemLength = ReadInt32();
{
- std::ostringstream s;
- s << "Basic Item Length is: "
- << itemLength << std::endl;
- s << " at address: " << (unsigned)currentPosition << std::endl;
- gdcmVerboseMacro("Document::ReadItemTagLength: " << s.str().c_str());
+ gdcmVerboseMacro( "Basic Item Length is: "
+ << itemLength << std::endl
+ << " at address: " << (unsigned int)currentPosition);
}
return itemLength;
}
{
uint32_t individualLength = str2num( &basicOffsetTableItemValue[i],
uint32_t);
- std::ostringstream s;
- s << " Read one length: ";
- s << std::hex << individualLength << std::endl;
- gdcmVerboseMacro(0,
- "Document::ReadAndSkipEncapsulatedBasicOffsetTable: ",
- s.str().c_str());
+ gdcmVerboseMacro( "Read one length: " <<
+ std::hex << individualLength );
}
#endif //GDCM_DEBUG
if ( nbRleSegments > 16 )
{
// There should be at most 15 segments (refer to RLEFrame class)
- gdcmVerboseMacro("Document::ComputeRLEInfo: too many segments.");
+ gdcmVerboseMacro( "Too many segments.");
}
uint32_t rleSegmentOffsetTable[16];
// Delimiter Item':
if ( !ReadTag(0xfffe, 0xe0dd) )
{
- gdcmVerboseMacro("Document::ComputeRLEInfo: no sequence delimiter "
- " item at end of RLE item sequence");
+ gdcmVerboseMacro( "No sequence delimiter item at end of RLE item sequence");
}
}
// Delimiter Item':
if ( !ReadTag(0xfffe, 0xe0dd) )
{
- gdcmVerboseMacro("Document::ComputeRLEInfo: no sequence delimiter "
- " item at end of JPEG item sequence");
+ gdcmVerboseMacro( "No sequence delimiter item at end of JPEG item sequence");
}
}
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.39 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if( TagHT.count(key) == 1 )
{
- gdcmVerboseMacro("ElementSet::AddEntry key already present: " <<
- key.c_str());
+ gdcmVerboseMacro( "Key already present: " << key.c_str());
return false;
}
else
if( TagHT.count(key) == 1 )
{
TagHT.erase(key);
- gdcmVerboseMacro( "ElementSet::RemoveEntry: one element erased.");
+ gdcmVerboseMacro( "One element erased.");
delete entryToRemove;
return true;
}
- gdcmVerboseMacro("ElementSet::RemoveEntry: key not present");
+ gdcmVerboseMacro( "Key not present");
return false ;
}
if( TagHT.count(key) == 1 )
{
TagHT.erase(key);
- gdcmVerboseMacro("ElementSet::RemoveEntry: one element erased.");
+ gdcmVerboseMacro( "One element erased.");
return true;
}
- gdcmVerboseMacro("ElementSet::RemoveEntry: key not present");
+ gdcmVerboseMacro( "Key not present");
return false ;
}
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.185 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.186 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if ( PixelReadConverter->GetRGBSize() > maxSize )
{
- gdcmVerboseMacro("File::GetImageDataIntoVector: pixel data bigger"
- "than caller's expected MaxSize");
+ gdcmVerboseMacro( "Pixel data bigger than caller's expected MaxSize");
return 0;
}
memcpy( destination,
// Either no LUT conversion necessary or LUT conversion failed
if ( PixelReadConverter->GetRawSize() > maxSize )
{
- gdcmVerboseMacro("File::GetImageDataIntoVector: pixel data bigger"
- "than caller's expected MaxSize");
+ gdcmVerboseMacro( "Pixel data bigger than caller's expected MaxSize");
return 0;
}
memcpy( destination,
std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary );
if (!fp1)
{
- gdcmVerboseMacro("Fail to open (write) file:" << fileName.c_str());
+ gdcmVerboseMacro( "Fail to open (write) file:" << fileName.c_str());
return false;
}
- if(PixelWriteConverter->GetUserData())
- fp1.write((char*)PixelWriteConverter->GetUserData(), PixelWriteConverter->GetUserDataSize());
- else if(PixelReadConverter->GetRGB())
- fp1.write((char*)PixelReadConverter->GetRGB(), PixelReadConverter->GetRGBSize());
- else if(PixelReadConverter->GetRaw())
- fp1.write((char*)PixelReadConverter->GetRaw(), PixelReadConverter->GetRawSize());
+ if( PixelWriteConverter->GetUserData() )
+ {
+ fp1.write( (char*)PixelWriteConverter->GetUserData(),
+ PixelWriteConverter->GetUserDataSize() );
+ }
+ else if ( PixelReadConverter->GetRGB() )
+ {
+ fp1.write( (char*)PixelReadConverter->GetRGB(),
+ PixelReadConverter->GetRGBSize());
+ }
+ else if ( PixelReadConverter->GetRaw() )
+ {
+ fp1.write( (char*)PixelReadConverter->GetRaw(),
+ PixelReadConverter->GetRawSize());
+ }
+ else
+ {
+ gdcmErrorMacro( "Nothing written." );
+ }
fp1.close();
case WMODE_RAW :
if( decSize!=PixelWriteConverter->GetUserDataSize() )
{
- gdcmVerboseMacro("File::CheckWriteIntegrity: Data size is incorrect (Raw)");
- //std::cerr << "File::CheckWriteIntegrity: Data size is incorrect (Raw)\n"
- // << decSize << " / " << PixelWriteConverter->GetUserDataSize() << "\n";
+ gdcmVerboseMacro( "Data size is incorrect (Raw)" << decSize
+ << " / " << PixelWriteConverter->GetUserDataSize() );
return false;
}
break;
case WMODE_RGB :
if( rgbSize!=PixelWriteConverter->GetUserDataSize() )
{
- gdcmVerboseMacro( "File::CheckWriteIntegrity: Data size is incorrect (RGB)");
- //std::cerr << "File::CheckWriteIntegrity: Data size is incorrect (RGB)\n"
- // << decSize << " / " << PixelWriteConverter->GetUserDataSize() << "\n";
+ gdcmVerboseMacro( "Data size is incorrect (RGB)" << decSize
+ << " / " << PixelWriteConverter->GetUserDataSize() );
return false;
}
break;
raw = PixelReadConverter->GetRaw();
if ( ! raw )
{
- gdcmVerboseMacro("File::GetRaw: read/decompress of "
- "pixel data apparently went wrong.");
+ gdcmVerboseMacro( "Read/decompress of pixel data apparently went wrong.");
return 0;
}
}
Program: gdcm
Module: $RCSfile: gdcmGlobal.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if (ValRes || TranSyn || Dicts || ddElem)
{
- gdcmVerboseMacro("Global::Global : VR or TS or Dicts already allocated");
+ gdcmVerboseMacro( "VR or TS or Dicts already allocated");
return;
}
Dicts = new DictSet();
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.224 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.225 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if ( strSpacing == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetXSpacing: unfound Pixel Spacing (0028,0030)");
+ gdcmVerboseMacro( "Unfound Pixel Spacing (0028,0030)" );
return 1.;
}
if ( xspacing == 0.)
{
- gdcmVerboseMacro("Header::GetXSpacing: gdcmData/CT-MONO2-8-abdo.dcm problem");
+ gdcmVerboseMacro("gdcmData/CT-MONO2-8-abdo.dcm problem");
// seems to be a bug in the header ...
nbValues = sscanf( strSpacing.c_str(), "%f\\0\\%f", &yspacing, &xspacing);
assert( nbValues == 2 );
if ( strSpacing == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetYSpacing: unfound Pixel Spacing (0028,0030)");
+ gdcmVerboseMacro("Unfound Pixel Spacing (0028,0030)");
return 1.;
}
if ( strSpacingBSlices == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetZSpacing: unfound StrSpacingBSlices");
+ gdcmVerboseMacro("Unfound StrSpacingBSlices");
const std::string &strSliceThickness = GetEntryByNumber(0x0018,0x0050);
if ( strSliceThickness == GDCM_UNFOUND )
{
if( sscanf( strRescInter.c_str(), "%f", &resInter) != 1 )
{
// bug in the element 0x0028,0x1052
- gdcmVerboseMacro("Header::GetRescaleIntercept: Rescale Slope "
- "is empty");
+ gdcmVerboseMacro( "Rescale Intercept is empty." );
}
}
if( sscanf( strRescSlope.c_str(), "%f", &resSlope) != 1)
{
// bug in the element 0x0028,0x1053
- gdcmVerboseMacro("Header::GetRescaleSlope: Rescale Slope is empty");
+ gdcmVerboseMacro( "Rescale Slope is empty.");
}
}
if ( strImPos == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetXImagePosition: unfound Image "
- "Position Patient (0020,0032)");
+ gdcmVerboseMacro( "Unfound Image Position Patient (0020,0032)");
strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images
if ( strImPos == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetXImagePosition: unfound Image "
- "Position (RET) (0020,0030)");
+ gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)");
/// \todo How to tell the caller nothing was found ?
return 0.;
}
if ( strImPos == GDCM_UNFOUND)
{
- gdcmVerboseMacro("Header::GetYImagePosition: unfound Image "
- "Position Patient (0020,0032)");
+ gdcmVerboseMacro( "Unfound Image Position Patient (0020,0032)");
strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images
if ( strImPos == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetYImagePosition: unfound Image "
- "Position (RET) (0020,0030)");
+ gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)");
/// \todo How to tell the caller nothing was found ?
return 0.;
}
{
if( sscanf( strImPos.c_str(), "%f\\%f\\%f", &xImPos, &yImPos, &zImPos) != 3)
{
- gdcmVerboseMacro("Header::GetZImagePosition: wrong Image "
- "Position Patient (0020,0032)");
+ gdcmVerboseMacro( "Wrong Image Position Patient (0020,0032)");
return 0.; // bug in the element 0x0020,0x0032
}
else
if( sscanf( strImPos.c_str(),
"%f\\%f\\%f", &xImPos, &yImPos, &zImPos ) != 3 )
{
- gdcmVerboseMacro("Header::GetZImagePosition: wrong Image Position (RET) (0020,0030)");
+ gdcmVerboseMacro( "Wrong Image Position (RET) (0020,0030)");
return 0.; // bug in the element 0x0020,0x0032
}
else
{
if( sscanf( strSliceLocation.c_str(), "%f", &zImPos) != 1)
{
- gdcmVerboseMacro("Header::GetZImagePosition: wrong Slice Location (0020,1041)");
+ gdcmVerboseMacro( "Wrong Slice Location (0020,1041)");
return 0.; // bug in the element 0x0020,0x1041
}
else
return zImPos;
}
}
- gdcmVerboseMacro("Header::GetZImagePosition: unfound Slice Location (0020,1041)");
+ gdcmVerboseMacro( "Unfound Slice Location (0020,1041)");
std::string strLocation = GetEntryByNumber(0x0020,0x0050);
if ( strLocation != GDCM_UNFOUND )
{
if( sscanf( strLocation.c_str(), "%f", &zImPos) != 1)
{
- gdcmVerboseMacro("Header::GetZImagePosition: wrong Location (0020,0050)");
+ gdcmVerboseMacro( "Wrong Location (0020,0050)");
return 0.; // bug in the element 0x0020,0x0050
}
else
return zImPos;
}
}
- gdcmVerboseMacro("Header::GetYImagePosition: unfound Location (0020,0050)");
+ gdcmVerboseMacro( "Unfound Location (0020,0050)");
return 0.; // Hopeless
}
std::string strSize = GetEntryByNumber( 0x0028, 0x0101 );
if ( strSize == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetBitsStored: this is supposed to "
- "be mandatory");
+ gdcmVerboseMacro("This is supposed to be mandatory");
return 0; // It's supposed to be mandatory
// the caller will have to check
}
std::string strSize = GetEntryByNumber( 0x0028, 0x0102 );
if ( strSize == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetHighBitPosition: this is supposed "
- "to be mandatory");
+ gdcmVerboseMacro( "This is supposed to be mandatory");
return 0;
}
return atoi( strSize.c_str() );
std::string strSize = GetEntryByNumber( 0x0028, 0x0103 );
if ( strSize == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::IsSignedPixelData: this is supposed "
- "to be mandatory");
+ gdcmVerboseMacro( "This is supposed to be mandatory");
return false;
}
int sign = atoi( strSize.c_str() );
std::string strSize = GetEntryByNumber(0x0028,0x0100);
if ( strSize == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetBitsStored: this is supposed to "
- "be mandatory");
+ gdcmVerboseMacro( "This is supposed to be mandatory");
return 0; // It's supposed to be mandatory
// the caller will have to check
}
const std::string& strSize = GetEntryByNumber(0x0028,0x0002);
if ( strSize == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetBitsStored: this is supposed to "
- "be mandatory");
+ gdcmVerboseMacro( "This is supposed to be mandatory");
return 1; // Well, it's supposed to be mandatory ...
// but sometimes it's missing : *we* assume Gray pixels
}
}
if ( PhotometricInterp == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::IsMonochrome: absent Photometric "
- "Interpretation");
+ gdcmVerboseMacro( "Absent Photometric Interpretation");
}
return false;
}
}
if ( PhotometricInterp == GDCM_UNFOUND )
{
- gdcmVerboseMacro( "Header::IsPaletteColor: absent Photometric "
- "Interpretation");
+ gdcmVerboseMacro( "Absent Palette color");
}
return false;
}
}
if ( PhotometricInterp == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::IsYBRFull: absent Photometric "
- "Interpretation");
+ gdcmVerboseMacro( "Absent YBR Full");
}
return false;
}
std::string strSize = GetEntryByNumber(0x0028,0x0006);
if ( strSize == GDCM_UNFOUND )
{
+ gdcmVerboseMacro( "Absent Planar Configuration");
return 0;
}
return atoi( strSize.c_str() );
{
return 8;
}
- gdcmVerboseMacro("Header::GetPixelSize: Unknown pixel type");
+ gdcmVerboseMacro( "Unknown pixel type");
return 0;
}
std::string bitsAlloc = GetEntryByNumber(0x0028, 0x0100); // Bits Allocated
if ( bitsAlloc == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetPixelType: unfound Bits Allocated");
+ gdcmVerboseMacro( "Unfound Bits Allocated");
bitsAlloc = "16";
}
if (sign == GDCM_UNFOUND )
{
- gdcmVerboseMacro("Header::GetPixelType: unfound Pixel Representation");
+ gdcmVerboseMacro( "Unfound Pixel Representation");
bitsAlloc = "0";
}
else if ( sign == "0" )
if ( transfertSyntax == GDCM_NOTLOADED )
{
- std::cout << "Transfert Syntax not loaded. " << std::endl
- << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
- << std::endl;
+ gdcmVerboseMacro( "Transfert Syntax not loaded. " << std::endl
+ << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" );
return "Uncompressed ACR-NEMA";
}
if ( transfertSyntax == GDCM_UNFOUND )
{
- gdcmVerboseMacro( "Header::GetTransfertSyntaxName:"
- " unfound Transfert Syntax (0002,0010)");
+ gdcmVerboseMacro( "Unfound Transfert Syntax (0002,0010)");
return "Uncompressed ACR-NEMA";
}
if( sscanf( strImOriPat.c_str(), "%f\\%f\\%f\\%f\\%f\\%f",
&iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 )
{
- gdcmVerboseMacro("Header::GetImageOrientationPatient: "
- "wrong Image Orientation Patient (0020,0037)");
+ gdcmVerboseMacro( "Wrong Image Orientation Patient (0020,0037). Less than 6 values were found." );
}
}
//For ACR-NEMA
if( sscanf( strImOriPat.c_str(), "%f\\%f\\%f\\%f\\%f\\%f",
&iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 )
{
- gdcmVerboseMacro("Header::GetImageOrientationPatient: "
- "wrong Image Orientation Patient (0020,0035)");
+ gdcmVerboseMacro( "wrong Image Orientation Patient (0020,0035). Less than 6 values were found." );
}
}
}
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:38 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if ( numberOfReadBytes > fragmentSize )
{
- gdcmVerboseMacro("PixelReadConvert::ReadAndDecompressRLEFragment: we "
- "read more bytes than the segment size.");
+ gdcmVerboseMacro( "Read more bytes than the segment size.");
return false;
}
}
}
break;
default:
- gdcmVerboseMacro( "PixelReadConvert::ConvertSwapZone: SwapCode value "
- "(16 bits) not allowed." );
+ gdcmVerboseMacro("SwapCode value (16 bits) not allowed.");
}
}
else if( BitsAllocated == 32 )
}
break;
default:
- gdcmVerboseMacro( "PixelReadConvert::ConvertSwapZone: SwapCode value "
- "(32 bits) not allowed." );
+ gdcmVerboseMacro("SwapCode value (32 bits) not allowed." );
}
}
}
}
else
{
- gdcmVerboseMacro("PixelReadConvert::ConvertReArrangeBits: weird image");
- throw FormatError( "PixelReadConvert::ConvertReArrangeBits()",
- "weird image !?" );
+ gdcmVerboseMacro("Weird image");
+ throw FormatError( "Weird image !?" );
}
}
return true;
//// First stage: get our hands on the Pixel Data.
if ( !fp )
{
- gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
- "unavailable file pointer." );
+ gdcmVerboseMacro( "Unavailable file pointer." );
return false;
}
fp->seekg( PixelOffset, std::ios::beg );
- if( fp->fail() || fp->eof()) //Fp->gcount() == 1
+ if( fp->fail() || fp->eof())
{
- gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
- "unable to find PixelOffset in file." );
+ gdcmVerboseMacro( "Unable to find PixelOffset in file." );
return false;
}
// variable). But RawSize is the right size of the image !
if( PixelDataLength != RawSize)
{
- gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
- "Mismatch between PixelReadConvert and RawSize." );
+ gdcmVerboseMacro( "Mismatch between PixelReadConvert and RawSize." );
}
if( PixelDataLength > RawSize)
{
fp->read( (char*)Raw, PixelDataLength);
}
- if ( fp->fail() || fp->eof())//Fp->gcount() == 1
+ if ( fp->fail() || fp->eof())
{
- gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
- "reading of Raw pixel data failed." );
+ gdcmVerboseMacro( "Reading of Raw pixel data failed." );
return false;
}
}
{
if ( ! ReadAndDecompressRLEFile( fp ) )
{
- gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
- "RLE decompressor failed." );
+ gdcmVerboseMacro( "RLE decompressor failed." );
return false;
}
}
// Default case concerns JPEG family
if ( ! ReadAndDecompressJPEGFile( fp ) )
{
- gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
- "JPEG decompressor failed." );
+ gdcmVerboseMacro( "JPEG decompressor failed." );
return false;
}
}
LutRedData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1201 );
if ( ! LutRedData )
{
- gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: "
- "unable to read red LUT data" );
+ gdcmVerboseMacro( "Unable to read red LUT data" );
}
////// Green round:
LutGreenData = (uint8_t*)header->GetEntryBinAreaByNumber(0x0028, 0x1202 );
if ( ! LutGreenData)
{
- gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: "
- "unable to read green LUT data" );
+ gdcmVerboseMacro( "Unable to read green LUT data" );
}
////// Blue round:
LutBlueData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1203 );
if ( ! LutBlueData )
{
- gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: "
- "unable to read blue LUT data" );
+ gdcmVerboseMacro( "Unable to read blue LUT data" );
}
}
&lengthR, &debR, &nbitsR );
if( nbRead != 3 )
{
- gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong red LUT descriptor");
+ gdcmVerboseMacro( "Wrong red LUT descriptor" );
}
int lengthG; // Green LUT length in Bytes
&lengthG, &debG, &nbitsG );
if( nbRead != 3 )
{
- gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong green LUT descriptor");
+ gdcmVerboseMacro( "Wrong green LUT descriptor" );
}
int lengthB; // Blue LUT length in Bytes
&lengthB, &debB, &nbitsB );
if( nbRead != 3 )
{
- gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong blue LUT descriptor");
+ gdcmVerboseMacro( "Wrong blue LUT descriptor" );
}
////////////////////////////////////////////////////////
}
else
{
- gdcmVerboseMacro("PixelReadConvert::Print: set as RLE file "
- "but NO RLEinfo present.");
+ gdcmVerboseMacro("Set as RLE file but NO RLEinfo present.");
}
}
}
else
{
- gdcmVerboseMacro("PixelReadConvert::Print: set as JPEG file "
- "but NO JPEGinfo present.");
+ gdcmVerboseMacro("Set as JPEG file but NO JPEGinfo present.");
}
}
}
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:39 $
- Version: $Revision: 1.47 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.48 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if( *it == entryToRemove)
{
DocEntries.erase(it);
- gdcmVerboseMacro( "SQItem::RemoveEntry: one element erased.");
+ gdcmVerboseMacro( "One element erased.");
delete entryToRemove;
return true;
}
}
-
- gdcmVerboseMacro( "SQItem::RemoveEntry: value not present ");
+ gdcmVerboseMacro( "Value not present.");
return false ;
}
-
+
/**
* \brief Clear the hash table from given entry BUT keep the entry.
* @param entryToRemove Entry to remove.
if( *it == entryToRemove)
{
DocEntries.erase(it);
- gdcmVerboseMacro( "SQItem::RemoveEntry: one element erased.");
+ gdcmVerboseMacro( "One element erased.");
return true;
}
}
- gdcmVerboseMacro( "SQItem::RemoveEntry: value not present ");
+ gdcmVerboseMacro( "Value not present.");
return false ;
}
Program: gdcm
Module: $RCSfile: gdcmTS.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:39 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.33 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ifstream from(filename.c_str());
if( !from )
{
- gdcmVerboseMacro("TS::TS: can't open dictionary" << filename.c_str());
+ gdcmVerboseMacro("Can't open dictionary" << filename.c_str());
FillDefaultTSDict( TsMap );
}
else
Program: gdcm
Module: $RCSfile: gdcmVR.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 19:20:39 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2005/01/07 22:03:30 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ifstream from(filename.c_str());
if(!from)
{
- gdcmVerboseMacro("VR::VR: can't open dictionary" << filename.c_str());
+ gdcmVerboseMacro("Can't open dictionary" << filename.c_str());
FillDefaultVRDict(vr);
}
else