From: davila Date: Wed, 23 Jul 2014 10:02:54 +0000 (+0200) Subject: 2433 BBTK Bug New Normal vtk::MetaImageWriter box Generation (null).###### files X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=85a4449b23bea122bcc2bde80540cc89a0f47504;p=bbtk.git 2433 BBTK Bug New Normal vtk::MetaImageWriter box Generation (null).###### files --- diff --git a/packages/vtk/src/bbvtkMetaImageWriter.xml b/packages/vtk/src/bbvtkMetaImageWriter.xml index 24789f3..cb55daa 100644 --- a/packages/vtk/src/bbvtkMetaImageWriter.xml +++ b/packages/vtk/src/bbvtkMetaImageWriter.xml @@ -29,16 +29,22 @@ */ - 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();