#include <creaImageIOImageReader.h>
#include <creaImageIOTreeAttributeDescriptor.h>
-
+#include <creaImageIOSystem.h>
#include <vtkImageReader2.h>
#include <vtkPNGReader.h>
{
if (str == "GDCM::Unfound")
{
- return "----";
+ return "";
}
if (str[str.size()-1]==' ')
{
std::map<std::string,std::string>& attr)
{
// std::cout << "SpecificVtkReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
+ GimmickMessage(2,"Reading attributes from '"<<filename<<std::endl);
// Get image dimensions
// How to get the image info without loading it in vtk ?
mVTKReader->SetFileName(filename.c_str());
char planes[128];
sprintf(planes,"%i",ext[5]-ext[4]);
+
//
std::map<std::string,std::string>::iterator i;
- if ( (i = attr.find("Full File Name")) != attr.end())
+ if ( (i = attr.find("FullFileName")) != attr.end())
+ {
+ // boost::filesystem::path full_path(filename);
+ // std::string f = full_path.leaf();
+ i->second = filename;
+ }
+ if ( (i = attr.find("D0004_1500")) != attr.end())
{
boost::filesystem::path full_path(filename);
std::string f = full_path.leaf();
i->second = f;
}
- if ( (i = attr.find("Columns")) != attr.end())
- {
- i->second = cols;
- }
- if ( (i = attr.find("Rows")) != attr.end())
+ if ( (i = attr.find("D0028_0010")) != attr.end())
{
i->second = rows;
}
- if ( (i = attr.find("Planes")) != attr.end())
- {
+ if ( (i = attr.find("D0028_0011")) != attr.end())
+ {
+ i->second = cols;
+ }
+
+ if ( (i = attr.find("D0028_0012")) != attr.end())
+ {
i->second = planes;
}
+
+ GimmickMessage(2,"Attributes map:"<<std::endl<<attr<<std::endl);
}
//=====================================================================
private:
std::map<std::string,std::string>& attr)
{
// std::cout << "DicomReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
+ GimmickMessage(2,"Reading attributes from DICOM file '"
+ <<filename<<"'"<<std::endl);
+
GDCM_NAME_SPACE::File* file = GDCM_NAME_SPACE::File::New();
file->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
file->SetFileName(filename.c_str());
std::map<std::string,std::string>::iterator i;
for (i=attr.begin();i!=attr.end();++i)
{
- if ( i->first == "FullFileName" )
+ if ( i->first == "D0004_1500" )
{
boost::filesystem::path full_path(filename);
std::string f = full_path.leaf();
i->second = f;
}
+ else if ( i->first == "FullFileName" )
+ {
+ i->second = filename;
+ }
else
{
uint16_t gr;
uint16_t el;
tree::AttributeDescriptor::GetDicomGroupElementFromKey(i->first,gr,el);
+ // GimmickMessage(2,"Key '"<<i->first<<"' : "<<gr<<"|"<<el
+ // <<std::endl);
if ( ( gr!=0 ) && ( el!=0 ) )
{
std::string val = file->GetEntryString(gr,el);
i->second = irclean(val);
+ // GimmickMessage(2,"Key '"<<i->first<<"' : "<<gr<<"|"<<el
+ // <<"="<<i->second<<std::endl);
}
}
}