int dimXMask = extMask[1]-extMask[0]+1;
int dimYMask = extMask[3]-extMask[2]+1;
int dimZMask = extMask[5]-extMask[4]+1;
-
double background = bbGetInputBackground();
double bgToAnalice = bbGetInputBackgroundToAnalice();
DEF_POINTER_IMAGE_VTK_CREA(vI,ssI,pI,stI, bbGetInputImage() );
DEF_POINTER_IMAGE_VTK_CREA(vM,ssM,pM,stM, bbGetInputMask() );
DEF_POINTER_IMAGE_VTK_CREA(vO,ssO,pO,stO, resultImage );
-
long int k1omp=(double)(size-1)*0.0;
long int k2omp=(double)(size-1)*0.2;
long int k3omp=(double)(size-1)*0.4;
double vMtmpOMP;
double vOtmpOMP;
GETVALUE2_VTK_CREA(vMtmpOMP,pM,stM,i);
-
if (bbGetInputType()==0) //Applay mask to new Image
{
GETVALUE2_VTK_CREA(vItmpOMP,pI,stI,i);
} // if vM
SETVALUE2_VTK_CREA(vOtmpOMP,pO,stO,i);
} // if Type==0
-
if (bbGetInputType()==1) //Modifiy the Input image with the Label value in Mask place
{
if (vMtmpOMP!=bgToAnalice)
SETVALUE2_VTK_CREA(vOtmpOMP,pO,stO,i);
}
} // if Type==1
-
if (bbGetInputType()==2) //Modifiy the Input image with the Mask value
{
if (vMtmpOMP!=bgToAnalice)
SETVALUE2_VTK_CREA(vOtmpOMP,pO,stO,i);
}
} // if Type==2
-
} // for
} //if dim
resultImage->Modified();
if ((bbGetInputInPolyData()!=NULL) && (bbGetInputInImage()!=NULL) )
{
-
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n ");
-
int ext[6];
bbGetInputInImage()->GetExtent( ext );
-
// vtkCleanPolyData *clean1 = vtkCleanPolyData::New();
if (clean1!=NULL) clean1->Delete();
clean1 = vtkCleanPolyData::New();
vtkTriangleFilter *triangle1 = vtkTriangleFilter::New();
triangle1->SetInputData( clean1->GetOutput() );
triangle1->Update();
-
// vtkPolyDataToImageStencil *dataToStencil = vtkPolyDataToImageStencil::New();
if (dataToStencil!=NULL) dataToStencil->Delete();
dataToStencil = vtkPolyDataToImageStencil::New();
dataToStencil->SetInputData( triangle1->GetOutput() );
dataToStencil->SetOutputWholeExtent( ext );
dataToStencil->Update();
-
// vtkExtractVOI *extract = vtkExtractVOI::New();
if (extract!=NULL) extract->Delete();
extract = vtkExtractVOI::New();
extract->SetInputData( bbGetInputInImage() );
extract->ReleaseDataFlagOff();
extract->Update();
-
// vtkImageStencil *stencil = vtkImageStencil::New();
if (stencil!=NULL) stencil->Delete();
stencil = vtkImageStencil::New();
stencil->ReverseStencilOn();
stencil->SetBackgroundValue( bbGetInputBackgroundValue() );
stencil->Update();
-
bbSetOutputOut( stencil->GetOutput() );
} else {
printf("EED Warnning! PolyDataToImageData::Process > Missing Image or PolyData inputs\n");
+ bbSetOutputOut( NULL);
}// if In 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)
//=====
void PolyDataToImageData::bbUserSetDefaultValues()
{
-
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
bbSetInputInPolyData(NULL);
bbSetInputInImage(NULL);
bbSetInputBackgroundValue(255);
-
}
//=====
// 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 PolyDataToImageData::bbUserInitializeProcessing()
{
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
dataToStencil = NULL;
extract = NULL;
stencil = 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)