gdcmDirList::gdcmDirList(std::string dirName,bool recursive)
{
name=dirName;
-
NormalizePath(name);
Explore(name,recursive);
}
std::string fileName;
NormalizePath(dirName);
-
#if defined(_MSC_VER) || (__CYGWIN__)
WIN32_FIND_DATA fileData;
HANDLE hFile=FindFirstFile((dirName+"*").c_str(),&fileData);
for (int i= 0;i < n; i++)
{
- fileName=namelist[i]->d_name;
+ fileName=namelist[i]->d_name;
if(namelist[i]->d_type==DT_DIR)
{
if( (fileName!=".") && (fileName!="..") && (recursive) )
// Entry
+// These functions are necessary for Python because
+// there are protected in the parent class
+
inline virtual std::string GetEntryByNumber (guint16 group, guint16 element)
{ return(gdcmParser::GetEntryByNumber(group,element)); }
*/
bool gdcmParser::Write(FILE *fp, FileType type) {
// ==============
-// TODO The stuff was rewritten using the chained list instead
-// of the H table
-// so we could remove the GroupHT from the gdcmParser
+// TODO The stuff will have to be rewritten using the SeQuence based
+// tree-like stucture instead of the chained list .
+// (so we shall remove the GroupHT from the gdcmParser)
// To be checked
// =============
/**
* \ingroup gdcmParser
* \brief Parses the header of the file and load element values.
- * @return false if file is not ACR-NEMA / DICOM
+ * @return false if file is not ACR-NEMA / PAPYRUS / DICOM
*/
bool gdcmParser::LoadHeaderEntries(bool exception_on_error) throw(gdcmFormatError) {
(void)exception_on_error;
SkipHeaderEntry(newHeaderEntry);
if ( (ignoreShadow==0) || (newHeaderEntry->GetGroup()%2) == 0) {
AddHeaderEntry(newHeaderEntry);
- LoadHeaderEntry(newHeaderEntry);
}
- }
+ }
rewind(fp);
-
+ // Be carefull : merging this two loops may cause troubles ...
+ for (ListTag::iterator i = GetListEntry().begin();
+ i != GetListEntry().end();
+ ++i)
+ {
+ LoadHeaderEntry(*i);
+ }
+ rewind(fp);
+
// Load 'non string' values
std::string PhotometricInterpretation = GetEntryByNumber(0x0028,0x0004);
std::string RecCode;
RecCode = GetEntryByNumber(0x0008, 0x0010); // recognition code
if (RecCode == "ACRNEMA_LIBIDO_1.1" ||
- RecCode == "CANRME_AILIBOD1_1." )
+ RecCode == "CANRME_AILIBOD1_1." ) // for brain-damaged softwares
+ // with "little-endian strings"
{
filetype = ACR_LIBIDO;
std::string rows = GetEntryByNumber(0x0028, 0x0010);