From 2e07001ca19daa5e58e0af4a6e5ebfbe75de91c5 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Tue, 5 Oct 2010 12:00:12 +0000 Subject: [PATCH] make sure names are in lexicographical order --- src/creaImageIOGimmick.cpp | 4 +--- src/creaImageIOGimmickView.cpp | 7 +++---- src/creaImageIOGimmickView.h | 2 +- src/creaImageIOSimpleView.cpp | 12 +++++++++--- src/creaImageIOVtkImageReader.cpp | 1 - 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/creaImageIOGimmick.cpp b/src/creaImageIOGimmick.cpp index 3ee7420..5c7b07f 100644 --- a/src/creaImageIOGimmick.cpp +++ b/src/creaImageIOGimmick.cpp @@ -443,12 +443,10 @@ path+= mLocalDescpName; else { std::vector::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)]; } } - - } diff --git a/src/creaImageIOGimmickView.cpp b/src/creaImageIOGimmickView.cpp index 93d286b..3e1224b 100644 --- a/src/creaImageIOGimmickView.cpp +++ b/src/creaImageIOGimmickView.cpp @@ -462,7 +462,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector& 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& s, std::vect } - ////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////// // create an output structure with n entries (T size) = T + n output ////////////////////////////////////////////////////////// void GimmickView::readImages4(std::vector& o_output, std::vector im, @@ -685,7 +685,6 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect - void GimmickView::ReadImagesNotThreadedInVector(std::vector& s, std::vector im, int dimension) { // Create the output data @@ -927,4 +926,4 @@ void GimmickView::ReadImagesNotThreadedInVector(std::vector& s, s // } //} // -} // EO namespace creaImageIO \ No newline at end of file +} // EO namespace creaImageIO diff --git a/src/creaImageIOGimmickView.h b/src/creaImageIOGimmickView.h index b073dc1..fed6e17 100644 --- a/src/creaImageIOGimmickView.h +++ b/src/creaImageIOGimmickView.h @@ -32,7 +32,7 @@ namespace creaImageIO vtkImageData *img; //std::map infos; mapInfoDicom infos; - }OutStrGimmick; + } OutStrGimmick; /** diff --git a/src/creaImageIOSimpleView.cpp b/src/creaImageIOSimpleView.cpp index becdd41..7a78629 100644 --- a/src/creaImageIOSimpleView.cpp +++ b/src/creaImageIOSimpleView.cpp @@ -29,7 +29,7 @@ namespace creaImageIO { bool bresult = true; ImageReader *mReader = new ImageReader(); - + std::vector 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; iReadImage(names[i]) ); + } } return bresult; } diff --git a/src/creaImageIOVtkImageReader.cpp b/src/creaImageIOVtkImageReader.cpp index 37f116e..0c38827 100644 --- a/src/creaImageIOVtkImageReader.cpp +++ b/src/creaImageIOVtkImageReader.cpp @@ -17,7 +17,6 @@ namespace creaImageIO{ { SetName ( "toto");// mReader->GetDescriptiveName()); } - } else { -- 2.47.1