]> Creatis software - bbtk.git/commitdiff
mhdb
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 28 Oct 2020 13:57:50 +0000 (14:57 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 28 Oct 2020 13:57:50 +0000 (14:57 +0100)
packages/vtk/src/bbvtkMetaImageWriter.xml

index d702d950b1893edb32214afacc6b48e55fc65a6e..7093390e3e74eeb2b1d4b3926b5253bf526f6d3c 100644 (file)
@@ -17,7 +17,6 @@
  
  <process><PRE>
 
-   vtkMetaImageWriter* w = vtkMetaImageWriter::New();
 
 
 //EED 2017-01-01 Migration VTK7
        // ...
 #endif
 
-/*
-   if (bbGetInputIn() == 0)
-      std::cout << "======================= Katastrophe : bbGetInputIn() == 0 " << std::endl;
-   else
-      std::cout << "======================= OK : bbGetInputIn() not NULL " << std::endl;
 
-   bbGetInputIn()->PrintSelf(std::cout, vtkIndent(1));
-   bbGetInputIn()->GetSpacing(spacing);
-   std::cout << "=======" << spacing[0] << " " << spacing[1] << " " << spacing[2] << std::endl;
-*/
-
-
-  if (bbGetInputIn()!=NULL)
-  {
-
-//EED 2017-01-01 Migration VTK7
-#if VTK_MAJOR_VERSION <= 5
-     w->SetInput(bbGetInputIn());
-#else
-     w->SetInputData(bbGetInputIn());
-#endif
-     w->SetCompression(bbGetInputCompression());  
-     w->SetFileDimensionality(bbGetInputIn()->GetDataDimension()); // NTU
-     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
-//EEDJuly22-2014     w->Update(); // Fred  
-     w->Write();
-   } // bbGetInputIn()!=NULL
-
-   w->Delete();
+       std::string userGivenName = bbGetInputFilename();
+       if (bbGetInputIn()!=NULL)
+       {
+               if (userGivenName.substr(userGivenName.size()-5) == ".mhdb")  
+               { 
+                       printf("EED vtkMetaImageWriter process  block..\n");
+               } else {
+                               if (userGivenName.substr(userGivenName.size()-4) != ".mhd")  //JPR
+                               { 
+                                       userGivenName += ".mhd";
+                               }
+                          vtkMetaImageWriter* w = vtkMetaImageWriter::New();
+       //EED 2017-01-01 Migration VTK7
+       #if VTK_MAJOR_VERSION <= 5
+                                w->SetInput(bbGetInputIn());
+       #else
+                                w->SetInputData(bbGetInputIn());
+       #endif
+                                w->SetCompression(bbGetInputCompression());  
+                                w->SetFileDimensionality(bbGetInputIn()->GetDataDimension());  // NTU
+                                w->SetFileName(userGivenName.c_str());  
+                                //w->SetFileName(bbGetInputFilename().c_str());                                // JPR
+                                w->Write();
+                                w->Delete();
+               } // .mhdb
+       } // bbGetInputIn()!=NULL
  </PRE></process>
 
  <defaultValues>