]> Creatis software - bbtk.git/commitdiff
Generate a good file name when .mhd is missing
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 1 Jun 2011 12:27:19 +0000 (12:27 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 1 Jun 2011 12:27:19 +0000 (12:27 +0000)
packages/vtk/src/bbvtkMetaImageWriter.xml

index 1d278aa64f9933329df63603b5daa97f5b984c81..24789f33dc5aab7077885b3d0bf3f34871236516 100644 (file)
    std::cout << "=======" << spacing[0] << " " << spacing[1] << " " << spacing[2] << std::endl;
 */
 
+
    w->SetInput(bbGetInputIn());
    w->SetCompression(false);  // JPR
    w->SetFileDimensionality(bbGetInputIn()->GetDataDimension()); // NTU
-   w->SetFileName(bbGetInputFilename().c_str());
+   std::string userGivenName = bbGetInputFilename();
+   if (userGivenName.substr(userGivenName.size()-4) != ".mhd") //JPR
+      userGivenName += ".mhd";
+    w->SetFileName(userGivenName.c_str());  
+   //w->SetFileName(bbGetInputFilename().c_str());  // JPR
    w->Update(); // Fred  
    w->Write();
    w->Delete();