-std::cout << "a"<<std::endl;
-//vtkImageData* in = vtkImageData::New();
-// in->ShallowCopy(bbGetInputIn());
-bbGetInputIn()->Update();
- w->SetInput(bbGetInputIn());
- w->SetFileName(bbGetInputFilename().c_str());
-
-bbGetInputIn()->Print(std::cout);
-std::cout << "a '"<< bbGetInputFilename()<<"'"<<std::endl;
- w->Update();
-std::cout << "a"<<std::endl;
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ bbGetInputIn()->Update();
+#else
+ // ...
+#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
+