]> Creatis software - creaImageIO.git/blobdiff - bbtk/src/bbcreaImageIOGetDicomAttributesFromMaps.cxx
#3188 creaImageIO Bug New Normal - DICOM tags
[creaImageIO.git] / bbtk / src / bbcreaImageIOGetDicomAttributesFromMaps.cxx
index 1dd7d1b2b359d38190d51ec92c26c7803b4fc4dd..98bdb5742217c7d01ccbd5210274da2c0be0786e 100644 (file)
@@ -13,7 +13,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(GetDicomAttributesFromMaps,bbtk::AtomicBlackBox);
 //===== 
 void GetDicomAttributesFromMaps::Process()
 {
-
 // THE MAIN PROCESSING METHOD BODY
 //   Here we simply set the input 'In' value to the output 'Out'
 //   And print out the output value
@@ -29,16 +28,22 @@ void GetDicomAttributesFromMaps::Process()
     std::vector< std::string > lstResult;
     std::map <std::string,std::string> tmpMap;
     int i,size=bbGetInputIn().size();
-    std::string strElement;
+
+// The MAP.find() function   is not working in all the cases
 
     for (i=0;i<size;i++)
     { 
                tmpMap = bbGetInputIn()[i];
-               strElement      = tmpMap.find( bbGetInputKeyDicom() )->second;
-               lstResult.push_back( strElement );
+               std::map<std::string, std::string>::iterator it;
+               for ( it = tmpMap.begin(); it != tmpMap.end(); it++ )
+               {
+                       if (it->first==bbGetInputKeyDicom())
+                       {
+                               lstResult.push_back( it->second );
+                       } // if it->first
+               }//for it
     } // for i
     bbSetOutputOut( lstResult );
-  
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)