//=====
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");
-
}
//=====
//=====
void ImageDataStructuredPoints::Process()
{
- vtkImageDataStrucPoints idsp;
- idsp.joinComponents(bbGetInputX(), bbGetInputY(), bbGetInputZ(),
- bbGetInputData1(), bbGetInputData2(), bbGetInputData3(),
- bbGetInputData4(), bbGetInputData5(), bbGetInputData6() );
- bbSetOutputImageEnsemble( idsp.getStructuredPoints() );
+ vtkImageDataStrucPoints idsp;
+ idsp.joinComponents(bbGetInputX(), bbGetInputY(), bbGetInputZ(),
+ bbGetInputData1(), bbGetInputData2(), bbGetInputData3(),
+ bbGetInputData4(), bbGetInputData5(), bbGetInputData6() );
+ bbSetOutputImageEnsemble( idsp.getStructuredPoints() );
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void ImageDataStructuredPoints::bbUserSetDefaultValues()
{
- bbSetInputX(NULL);
- bbSetInputY(NULL);
- bbSetInputZ(NULL);
- bbSetInputData1(NULL);
- bbSetInputData2(NULL);
- bbSetInputData3(NULL);
- bbSetInputData4(NULL);
- bbSetInputData5(NULL);
- bbSetInputData6(NULL);
+ bbSetInputX(NULL);
+ bbSetInputY(NULL);
+ bbSetInputZ(NULL);
+ bbSetInputData1(NULL);
+ bbSetInputData2(NULL);
+ bbSetInputData3(NULL);
+ bbSetInputData4(NULL);
+ bbSetInputData5(NULL);
+ bbSetInputData6(NULL);
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
// * TYPE is the C++ type of the input/output
// (the one provided in the attribute 'type' of the tag 'input')
- _boxcreavtkplanewidget.SetActive( bbGetInputActive() );
- _boxcreavtkplanewidget.SetImage( bbGetInputIn() );
- _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() );
- _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() );
- _boxcreavtkplanewidget.Process();
- bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
- bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() );
- bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() );
+ if ((bbGetInputIn()==NULL) || (bbGetInputRenderer()==NULL))
+ {
+ bbSetOutputOut( NULL );
+ std::vector<double> center;
+ std::vector<double> normal;
+ bbSetOutputCenter( center );
+ bbSetOutputNormal( normal );
+ } else {
+ _boxcreavtkplanewidget.SetActive( bbGetInputActive() );
+ _boxcreavtkplanewidget.SetImage( bbGetInputIn() );
+ _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() );
+ _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() );
+ _boxcreavtkplanewidget.Process();
+ bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
+ bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() );
+ bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() );
+ }
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
vtkImageDataStrucPoints::vtkImageDataStrucPoints()
{
+ _structuredPoints=NULL;
}
vtkImageDataStrucPoints::~vtkImageDataStrucPoints()
vtkImageData* Data1, vtkImageData* Data2, vtkImageData* Data3 ,
vtkImageData* Data4, vtkImageData* Data5, vtkImageData* Data6 )
{
-printf("EED vtkImageDataStrucPoints::joinComponents Start \n");
-
if ((imageX!=NULL) && (imageY!=NULL) && (imageZ!=NULL) )
{
int ext[6];
dim[2]=ext[5]-ext[4]+1;
imageY->GetSpacing(spc);
double *ptrX=NULL, *ptrY=NULL, *ptrZ=NULL;
- double *ptrD1=NULL, *ptrD2=NULL, *ptrD3=NULL, *ptrD4=NULL, *ptrD5=NULL, *ptrD6=NULL;
-
+ double *ptrD1=NULL, *ptrD2=NULL, *ptrD3=NULL, *ptrD4=NULL, *ptrD5=NULL, *ptrD6=NULL;
if (imageX!=NULL) ptrX = (double *)imageX->GetScalarPointer();
if (imageY!=NULL) ptrY = (double *)imageY->GetScalarPointer();
if (imageZ!=NULL) ptrZ = (double *)imageZ->GetScalarPointer();
if (Data4 !=NULL) ptrD4 = (double *)Data4->GetScalarPointer();
if (Data5 !=NULL) ptrD5 = (double *)Data5->GetScalarPointer();
if (Data6 !=NULL) ptrD6 = (double *)Data6->GetScalarPointer();
-
long int sizeimage = dim[0]*dim[1]*dim[2];
int components=3;
// if ((Data1!=NULL) && (Data2==NULL) && (Data3==NULL) && (Data4==NULL) && (Data5==NULL) && (Data6==NULL) ) { components=4; }
array2->SetNumberOfComponents(1);
array2->Allocate(sizeimage*1, 100 ); // ???
array2->SetName("angle");
-
printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n");
printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n");
printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n");
printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n");
printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n");
printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n");
-
double vx,vy,vz,d1=0,d2=0,d3=0,d4=0,d5=0,d6=0;
int i;
for( i = 0 ; i < sizeimage ; i++ )
} else {
printf("EED Warnning! vtkImageDataStrucPoints::joinComponents imageX or image Y or image Z is EMPTY\n");
+ _structuredPoints=NULL;
} // imageX imageY imageZ
-
-
-
-printf("EED vtkImageDataStrucPoints::joinComponents End\n");
-
}
vtkStructuredPoints* vtkImageDataStrucPoints::getStructuredPoints()