From f44e0632e281722a935ab750c15b1ac19b1002c2 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 28 Oct 2020 14:57:50 +0100 Subject: [PATCH] mhdb --- packages/vtk/src/bbvtkMetaImageWriter.xml | 61 ++++++++++------------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/packages/vtk/src/bbvtkMetaImageWriter.xml b/packages/vtk/src/bbvtkMetaImageWriter.xml index d702d95..7093390 100644 --- a/packages/vtk/src/bbvtkMetaImageWriter.xml +++ b/packages/vtk/src/bbvtkMetaImageWriter.xml @@ -17,7 +17,6 @@
 
-   vtkMetaImageWriter* w = vtkMetaImageWriter::New();
 
 
 //EED 2017-01-01 Migration VTK7
@@ -27,41 +26,33 @@
 	// ...
 #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
  
-- 2.47.1