*/
- 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>