Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/04/14 14:26:19 $
- Version: $Revision: 1.137 $
+ Date: $Date: 2005/05/03 09:43:04 $
+ Version: $Revision: 1.138 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
// Public
-void DicomDir::Load(std::string const &fileName )
+bool DicomDir::Load(std::string const &fileName )
{
Filename = fileName;
// We should clean out anything that already exists.
Fp = 0;
if ( !OpenFile() )
{
- return;
+ return false;
}
Document::Load(fileName);
if ( GetFirstEntry() == 0 ) // when user passed a Directory to parse
{
gdcmWarningMacro( "Entry HT empty for file: "<< fileName);
- return;
+ return false;
}
// Directory record sequence
DocEntry *e = GetDocEntry(0x0004, 0x1220);
{
gdcmWarningMacro( "NO 'Directory record sequence' (0x0004,0x1220)"
<< " in file " << fileName);
+ return false;
}
else
CreateDicomDir();
gdcmWarningMacro( "Parse directory and create the DicomDir : " << Filename );
ParseDirectory();
}
+ return true;
}
/**
Program: gdcm
Module: $RCSfile: gdcmDicomDir.h,v $
Language: C++
- Date: $Date: 2005/04/14 14:26:19 $
- Version: $Revision: 1.59 $
+ Date: $Date: 2005/05/03 09:43:04 $
+ 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
~DicomDir();
- void Load( std::string const &filename );
+ bool Load( std::string const &filename );
void Print(std::ostream &os = std::cout, std::string const &indent = "" );
void SetParseDir(bool parseDir) { ParseDir = parseDir; };
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/04/29 15:10:55 $
- Version: $Revision: 1.238 $
+ Date: $Date: 2005/05/03 09:43:04 $
+ Version: $Revision: 1.239 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Loader
* @param filename 'Document' (File or DicomDir) to be opened for parsing
+ * @return false if file cannot be open or no swap info was found,
+ * or no tag was found.
*/
-void Document::Load( std::string const &fileName )
+bool Document::Load( std::string const &fileName )
{
// We should clean out anything that already exists.
// Check IsDocumentAlreadyLoaded to be sure.
if( IsDocumentAlreadyLoaded )
{
- gdcmWarningMacro( "A file was already parsed inside this " <<
- "gdcm::Document (previous name was: "
+ gdcmWarningMacro( "A file was already parsed inside this "
+ << "gdcm::Document (previous name was: "
<< Filename.c_str() << ". New name is :"
<< fileName );
// todo : clean out the 'Document'
//gdcmWarningMacro( "Unable to open as an ACR/DICOM file: "
// << Filename.c_str() );
Filetype = Unknown;
- return;
+ return false;
}
Group0002Parsed = false;
gdcmWarningMacro( "Neither a DICOM V3 nor an ACR-NEMA file: "
<< Filename.c_str());
CloseFile();
- return ;
+ return false;
}
long beg = Fp->tellg(); // just after DICOM preamble (if any)
gdcmWarningMacro( "No tag in internal hash table for: "
<< Filename.c_str());
CloseFile();
- return ;
+ return false;
}
IsDocumentAlreadyLoaded = true;
SetValEntry(rows , 0x0028, 0x0011);
}
// --- End of ACR-LibIDO kludge ---
+
+ return true;
}
/**
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2005/04/26 16:18:23 $
- Version: $Revision: 1.109 $
+ Date: $Date: 2005/05/03 09:43:04 $
+ Version: $Revision: 1.110 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef std::list<Element> ListElements;
// Loading
- virtual void Load( std::string const &filename );
+ virtual bool Load( std::string const &filename );
// Dictionaries
Dict *GetPubDict();