// * TYPE is the C++ type of the input/output
// (the one provided in the attribute 'type' of the tag 'input')
+ vtkImageData *result=NULL;
+
if (bbGetInputIn()!=NULL)
{
if (imgConnfilter) {imgConnfilter->Delete();}
imgConnfilter=vtkImageConnectivityFilter::New();
imgConnfilter->SetInputData( bbGetInputIn() );
+ if (bbGetInputScalarRange().size()==2)
+ {
+ imgConnfilter->SetScalarRange( bbGetInputScalarRange()[0], bbGetInputScalarRange()[1] );
+ printf("EED ImageConnectivityFilter Scalar Range %f %f \n", bbGetInputScalarRange()[0], bbGetInputScalarRange()[1]);
+ } // Range
+
if (bbGetInputExtractionMode()==0) // LargestRegion
{
imgConnfilter->SetExtractionModeToLargestRegion();
- } // ExtractionMode
+ imgConnfilter->Update( );
+ result = imgConnfilter->GetOutput();
+ } // ExtractionMode 0
if (bbGetInputExtractionMode()==1) // AllRegions
{
- printf("EED Warning!!!! ImageConnectivityFilter - AllRegions Not Implemented\n ");
- } // ExtractionMode
+ printf("EED Warning!!!! ImageConnectivityFilter - AllRegions Not Implemented\n");
+ imgConnfilter->Update( );
+ result = imgConnfilter->GetOutput();
+ } // ExtractionMode 1
if (bbGetInputExtractionMode()==2) // SeedRegions
{
+ printf("EED ImageConnectivityFilter 1\n");
+ imgConnfilter->SetExtractionModeToSeededRegions();
std::vector<double> lstX = bbGetInputLstX();
std::vector<double> lstY = bbGetInputLstY();
std::vector<double> lstZ = bbGetInputLstZ();
- int size = lstX.size();
if ( (lstX.size()>0) && (lstX.size()==lstY.size()) && (lstX.size()==lstZ.size()) )
{
- int i;
+ printf("EED ImageConnectivityFilter 2\n");
+ int i,size = lstX.size();
double p[3];
vtkPoints *points = vtkPoints::New();
for (i=0; i<size; i++)
p[0] = lstX[i];
p[1] = lstY[i];
p[2] = lstZ[i];
+ printf("EED ImageConnectivityFilter 3 %f %f %f\n", p[0], p[1], p[2] );
points->InsertNextPoint(p);
} // for i
vtkPolyData *seedData = vtkPolyData::New();
// seedData->GetPointData()->SetScalars(seedScalars);
seedData->GetPointData()->SetScalars(nullptr);
- imgConnfilter->SetExtractionModeToSeededRegions();
imgConnfilter->SetSeedData( seedData );
// imgConnfilter->SetSizeRange(0, 99);
+ imgConnfilter->Update( );
+ printf("EED ImageConnectivityFilter 3\n");
+ result = imgConnfilter->GetOutput();
} // if lst
-
- } // ExtractionMode
-
- if (bbGetInputScalarRange().size()==2)
- {
- imgConnfilter->SetScalarRange( bbGetInputScalarRange()[0], bbGetInputScalarRange()[1] );
- } // Range
- imgConnfilter->Update( );
- bbSetOutputOut( imgConnfilter->GetOutput() );
+ } // ExtractionMode 2
+ bbSetOutputOut( result );
} else {
- printf("EED Warning!!!! ImageConnectivityFilter - Input image not defined.\n ");
+ printf("EED Warning!!!! ImageConnectivityFilter - Input image not defined.\n ");
}// In
}
-//=====
+
+//=====
// 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 ImageConnectivityFilter::bbUserSetDefaultValues()
{
-
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
bbSetInputIn(NULL);
// bbSetInputScalarRange();
imgConnfilter=NULL;
bbSetInputExtractionMode(0);
-
}
-//=====
+
+//=====
// 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 ImageConnectivityFilter::bbUserInitializeProcessing()
{
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
-// if any
-
-
+// if any
}
-//=====
+
+//=====
// 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 ImageConnectivityFilter::bbUserFinalizeProcessing()
{
-
// THE FINALIZATION METHOD BODY :
// Here does nothing
// but this is where you should desallocate the internal/output pointers
// if any
-
}
-}
-// EO namespace bbcreaVtk
+
+}// EO namespace bbcreaVtk