// (the one provided in the attribute 'name' of the tag 'input')
// * TYPE is the C++ type of the input/output
// (the one provided in the attribute 'type' of the tag 'input')
- vtkImageData *m_image = vtkImageData::New();
- m_image = bbGetInputImage();
- int grayLevel = 0;
- std::vector<double> coord = bbGetInputCoordinate();
+// vtkImageData *m_image = vtkImageData::New();
+// m_image = bbGetInputImage();
- grayLevel = m_image->GetScalarComponentAsDouble(coord[0],coord[1],coord[2],0);
+ double grayLevel = -9999;
+ std::vector<double> coord = bbGetInputCoordinate();
+ if (bbGetInputImage()!=NULL)
+ {
+ grayLevel = bbGetInputImage()->GetScalarComponentAsDouble(coord[0],coord[1],coord[2],0);
+ }
bbSetOutputGrayLevel(grayLevel);
}