//=====
#include "bbcreaVtkGrayLevel.h"
#include "bbcreaVtkPackage.h"
+#include <math.h>
+
namespace bbcreaVtk
{
//=====
void GrayLevel::Process()
{
-
-printf ("EED GrayLevel::Process Start\n");
-
// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
// vtkImageData *m_image = vtkImageData::New();
// m_image = bbGetInputImage();
-
double grayLevel = -9999;
std::vector<double> coord = bbGetInputCoordinate();
-
int ext[6];
int maxX,maxY,maxZ;
-
double px,py,pz;
if (bbGetInputImage()!=NULL)
{
maxX = ext[1]-ext[0]+1;
maxY = ext[3]-ext[2]+1;
maxZ = ext[5]-ext[4]+1;
-
if (coord.size()==3)
{
if (bbGetInputWithSpacing()==true)
py = coord[1];
pz = coord[2];
}// if
-
px=round(px);
py=round(py);
pz=round(pz);
} else {
grayLevel = -9991;
} // if px py pz
-
-
} // coord
std::vector<double> lstGL;
std::vector<double> lstX = bbGetInputLstPointsX();
} else {
lstGL.push_back( -9991 );
}
-
}// for
bbSetOutputLstGrayLevel(lstGL);
} // if size of Lst
} // InputImage
bbSetOutputGrayLevel(grayLevel);
-
-printf ("EED GrayLevel::Process End\n");
-
}
//=====