+ //clitk::GetSortedIndex(locs, sliceIndex);
+ //Look for files into GDCMSeriesFileNames, because it sorts files correctly and take the order
+ const std::vector<std::string> & temp = nameGenerator->GetFileNames(*sn);
+ for(unsigned int i=0; i<files.size(); i++) {
+ int j(0);
+ while (sliceIndex.size()==i && j<temp.size()) {
+ const size_t last_slash_idx2 = temp[j].rfind('/');
+ std::string tempFilename(temp[j]);
+ if (std::string::npos != last_slash_idx2)
+ tempFilename = temp[j].substr(last_slash_idx2+1, temp[j].size()-1);
+ if (tempFilename == files[i])
+ sliceIndex.push_back(j);
+ ++j;
+ }
+ }
+