#include <creaImageIODicomImageReader.h>
-#include <gdcmFile.h>
+
#include <vtkGdcmReader.h>
#include <creaImageIOSystem.h>
#include "boost/filesystem/path.hpp"
#include <creaImageIOTreeAttributeDescriptor.h>
#include <vtkStringArray.h>
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
+
namespace creaImageIO
{
return str;
}
//========================================================================
-
+
//=====================================================================
void DicomImageReader::ReadAttributes(const std::string& filename,
std::map<std::string,std::string>& attr)
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();
+ boost::shared_ptr<GDCM_NAME_SPACE::File> file(GDCM_NAME_SPACE::File::New(), DicomImageReader::deleter());
GDCM_NAME_SPACE::Document *doc= GDCM_NAME_SPACE::File::New();
doc->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
file->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
file->SetFileName(filename.c_str());
file->Load();
- if (file->IsReadable() ||((GDCM_NAME_SPACE::Document*) file)->IsReadable())
+ if (file->IsReadable())// ||((GDCM_NAME_SPACE::Document*) file)->IsReadable())
{
std::map<std::string,std::string>::iterator i;
for (i=attr.begin();i!=attr.end();++i)
}
}
}
- file->Delete();
+ // file->Delete();
}
//=====================================================================