]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.cxx
#3282 creaVtk Feature New Normal - PolyDataInfo
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkGrayLevel.cxx
index 959c59c07ea56d4eff6eb8a54ed0762ba077277a..3939f547890db00092076fde792d500c178c19e7 100644 (file)
@@ -25,14 +25,17 @@ void GrayLevel::Process()
 //      (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);
     
 }