// << "'"
// <<std::endl;
+ GDCM_NAME_SPACE::Document*doc;
GDCM_NAME_SPACE::File* file = GDCM_NAME_SPACE::File::New();
file->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
file->SetFileName(filename.c_str());
file->Load();
bool ok = file->IsReadable();
+ if(!ok)
+ {
+ doc = (GDCM_NAME_SPACE::Document*)file;
+ ok = doc->IsReadable();
+ }
file->Delete();
return ok;
}
GimmickMessage(2,"Reading attributes from DICOM file '"
<<filename<<"'"<<std::endl);
- GDCM_NAME_SPACE::File* file = GDCM_NAME_SPACE::File::New();
+ GDCM_NAME_SPACE::File* file = GDCM_NAME_SPACE::File::New();
+
+ GDCM_NAME_SPACE::Document *doc= GDCM_NAME_SPACE::File::New();
+ doc->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
+ doc->SetFileName(filename.c_str());
+ doc->Load();
file->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
file->SetFileName(filename.c_str());
file->Load();
- if (file->IsReadable())
+ if (file->IsReadable() ||((GDCM_NAME_SPACE::Document*) file)->IsReadable())
{
std::map<std::string,std::string>::iterator i;
else if ( i->first == "FullFileName" )
{
i->second = filename;
+ }
+ else if ( i->first == "FullFileDirectory" )
+ {
+ std::string::size_type last_pos = filename.find_last_of("//");
+ //find first separator
+ i->second = filename.substr(0, last_pos);
}
else
{