]> Creatis software - bbtk.git/commitdiff
2433 BBTK Bug New Normal vtk::MetaImageWriter box Generation (null).###### files
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Wed, 23 Jul 2014 10:02:54 +0000 (12:02 +0200)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Wed, 23 Jul 2014 10:02:54 +0000 (12:02 +0200)
packages/vtk/src/bbvtkMetaImageWriter.xml

index 24789f33dc5aab7077885b3d0bf3f34871236516..cb55daadcdf662cc2c0b85e0a0dbeb5a3a56fa33 100644 (file)
 */
 
 
-   w->SetInput(bbGetInputIn());
-   w->SetCompression(false);  // JPR
-   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
-   w->Update(); // Fred  
-   w->Write();
+  if (bbGetInputIn()!=NULL)
+  {
+     w->SetInput(bbGetInputIn());
+     w->SetCompression(false);  // JPR
+     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();
  </PRE></process>
 </blackbox>