X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOImageReader.cpp;h=aa8012bc7228abf5c435387a21e13c85760ff72d;hb=f08880c40f6304be640c7f8702bbbe96f8d50b40;hp=63a87ce515b6db8261a0391a22a59e37aa7e95e3;hpb=9bcef355910f147e16a71ae068c1dcb99c1686de;p=creaImageIO.git diff --git a/src2/creaImageIOImageReader.cpp b/src2/creaImageIOImageReader.cpp index 63a87ce..aa8012b 100644 --- a/src2/creaImageIOImageReader.cpp +++ b/src2/creaImageIOImageReader.cpp @@ -1,6 +1,6 @@ #include #include - +#include #include #include @@ -25,7 +25,7 @@ namespace creaImageIO { if (str == "GDCM::Unfound") { - return "----"; + return ""; } if (str[str.size()-1]==' ') { @@ -157,6 +157,7 @@ namespace creaImageIO std::map& attr) { // std::cout << "SpecificVtkReader::ReadDicomInfo '"<SetFileName(filename.c_str()); @@ -173,26 +174,36 @@ namespace creaImageIO char planes[128]; sprintf(planes,"%i",ext[5]-ext[4]); + // std::map::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:"<& attr) { // std::cout << "DicomReader::ReadDicomInfo '"<SetLoadMode( GDCM_NAME_SPACE::LD_ALL); file->SetFileName(filename.c_str()); @@ -317,21 +331,29 @@ namespace creaImageIO std::map::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 '"<first<<"' : "<GetEntryString(gr,el); i->second = irclean(val); + // GimmickMessage(2,"Key '"<first<<"' : "<