]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkMetaImageWriter.xml
Generate a good file name when .mhd is missing
[bbtk.git] / 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();