]> Creatis software - clitk.git/commitdiff
Correct bug in the filename when the same filename is used
authordsarrut <dsarrut>
Tue, 22 Mar 2011 15:49:52 +0000 (15:49 +0000)
committerdsarrut <dsarrut>
Tue, 22 Mar 2011 15:49:52 +0000 (15:49 +0000)
vv/vvSlicerManager.cxx

index efcb58532ff33a98e6790915c83d958a8d6e11a9..9e66956e6ec953e566e303c86b5a87ef21b73e27 100644 (file)
@@ -114,13 +114,16 @@ void vvSlicerManager::SetFilename(std::string filename, int number)
   mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));
   mBaseFileNameNumber = number;
 
-  for(unsigned int i=0; i<mSlicers.size(); i++) {
-    mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
-  }
-  
+  mFileName = mBaseFileName;
   if (number != 0) {
     mFileName.append("_"+clitk::toString(number));
   }
+  mFileName.append(vtksys::SystemTools::GetFilenameLastExtension(filename));
+
+  for(unsigned int i=0; i<mSlicers.size(); i++) {
+    mSlicers[i]->SetFileName(mFileName);//vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
+  }
+  
 }
 //------------------------------------------------------------------------------