]> Creatis software - creaImageIO.git/commitdiff
make sure names are in lexicographical order
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Tue, 5 Oct 2010 12:00:12 +0000 (12:00 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Tue, 5 Oct 2010 12:00:12 +0000 (12:00 +0000)
src/creaImageIOGimmick.cpp
src/creaImageIOGimmickView.cpp
src/creaImageIOGimmickView.h
src/creaImageIOSimpleView.cpp
src/creaImageIOVtkImageReader.cpp

index 3ee74200b5422fecc40150d582903add50253e21..5c7b07fd4fb9e36f366c64b8fef7176e69c73b34 100644 (file)
@@ -443,12 +443,10 @@ path+= mLocalDescpName;
                   else
                   {
                            std::vector<std::string>::iterator it = i_attr.inside.begin();
-                          for(; it != i_attr.inside.end(); it++)
+                           for(; it != i_attr.inside.end(); it++)
                                   i_res[(*it)] = map_attr[(*it)];
                   }
           }
-          
-
   }
 
 
index 93d286b21952e2b6a33d5c0a8ddc79c98e3e40ff..3e1224b66c44f786abf094b46a218eb2db91f47b 100644 (file)
@@ -462,7 +462,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                // If we want only one output information structure, we set it outside the loop
                if(!i_attr.mult)
                {
-                       getAttributes(im.front(), o_output.front().infos,i_attr);
+                       getAttributes(im.front(), o_output.front().infos, i_attr);
                }
                
        }
@@ -564,7 +564,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
 
        }
 
-               //////////////////////////////////////////////////////////
+       //////////////////////////////////////////////////////////
        // create an output structure with n entries (T size) = T + n output
        //////////////////////////////////////////////////////////
        void GimmickView::readImages4(std::vector<OutStrGimmick>& o_output, std::vector<std::string> im,
@@ -685,7 +685,6 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
 
 
 
-
 void GimmickView::ReadImagesNotThreadedInVector(std::vector<vtkImageData*>& s, std::vector<std::string> im, int dimension)
 {
        // Create the output data
@@ -927,4 +926,4 @@ void GimmickView::ReadImagesNotThreadedInVector(std::vector<vtkImageData*>& s, s
 //     }
 //}
 //
-} // EO namespace creaImageIO
\ No newline at end of file
+} // EO namespace creaImageIO
index b073dc1a50590f1af302170251f3b236963dba37..fed6e1700e720b69e032f82f79f596337579e638 100644 (file)
@@ -32,7 +32,7 @@ namespace creaImageIO
                vtkImageData *img;
                //std::map<std::string, std::string> infos;
                mapInfoDicom infos; 
-       }OutStrGimmick;
+       } OutStrGimmick;
 
 
        /**
index becdd41fe6519a4276611f92f39625c445e2b6e3..7a7862926c7cac8a45617964aae06dc773604e51 100644 (file)
@@ -29,7 +29,7 @@ namespace creaImageIO
        {
                        bool bresult = true;
                        ImageReader *mReader = new ImageReader();
-
+                        std::vector<std::string> names;
                        bresult = boost::filesystem::exists( i_pathname );
                        if (bresult)
                        {
@@ -41,11 +41,17 @@ namespace creaImageIO
                                        {
                                                if( mReader->CanRead(itr->string()) )
                                                {
-                            std::cout << itr->filename().c_str() << std::endl;
-                                                       i_imgs.push_back( mReader->ReadImage(itr->string()) );  
+                                                       names.push_back(itr->string()); 
                                                }
                                        }
                                }
+                               std::sort (names.begin(), names.end()); // make sure names are in lexicographical order
+                               int lgr = names.size();
+                               
+                               for(int i=0; i<lgr; i++)
+                               {
+                                  i_imgs.push_back( mReader->ReadImage(names[i]) );  
+                               }                       
                        }
                        return bresult;
        }
index 37f116eb2d2c2a4d0e49fd9ddc1dd7f465b73226..0c38827d34066844d0e86983dbb87b77ea1e1f8d 100644 (file)
@@ -17,7 +17,6 @@ namespace creaImageIO{
                  {
                        SetName ( "toto");// mReader->GetDescriptiveName());
                  }
-               
       }
     else 
       {