v.push_back("dcm");
v.push_back("");
}
- //=====================================================================
-
+
//========================================================================
std::string irclean(const std::string& str)
{
return str;
}
//========================================================================
-
+ //=====================================================================
+
+
+ void DicomImageReader::getAttributes(const std::string filename,
+ std::map <std::string , std::string> &infos,std::vector<std::string> i_attr)
+ {
+ gdcm::Reader reader;
+ reader.SetFileName( filename.c_str() );
+ if (reader.Read())
+ {
+ std::vector<std::string>::iterator it = i_attr.begin();
+ for(;it != i_attr.end(); it++)
+ {
+ unsigned short el;
+ unsigned short gr;
+ sscanf((*it).c_str(),"D%04hx_%04hx",&gr,&el);
+ if ( ( gr!=0 ) && ( el!=0 ) )
+ {
+ infos[(*it)] = ( GetStringValueFromTag(reader.GetFile().GetDataSet().GetDataElement(gdcm::Tag(gr,el))) );
+ }
+ }
+ }
+
+ }
//=====================================================================
void DicomImageReader::ReadAttributes(const std::string& filename,
std::map<std::string,std::string>& attr)