From 85a4449b23bea122bcc2bde80540cc89a0f47504 Mon Sep 17 00:00:00 2001 From: davila Date: Wed, 23 Jul 2014 12:02:54 +0200 Subject: [PATCH] 2433 BBTK Bug New Normal vtk::MetaImageWriter box Generation (null).###### files --- packages/vtk/src/bbvtkMetaImageWriter.xml | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) 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(); -- 2.47.1