2 // 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)
4 #include "bbcreaVtkImageConnectivityFilter.h"
5 #include "bbcreaVtkPackage.h"
10 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageConnectivityFilter)
11 BBTK_BLACK_BOX_IMPLEMENTATION(ImageConnectivityFilter,bbtk::AtomicBlackBox);
13 // 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)
15 void ImageConnectivityFilter::Process()
18 // THE MAIN PROCESSING METHOD BODY
19 // Here we simply set the input 'In' value to the output 'Out'
20 // And print out the output value
21 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
22 // void bbSet{Input|Output}NAME(const TYPE&)
23 // const TYPE& bbGet{Input|Output}NAME() const
25 // * NAME is the name of the input/output
26 // (the one provided in the attribute 'name' of the tag 'input')
27 // * TYPE is the C++ type of the input/output
28 // (the one provided in the attribute 'type' of the tag 'input')
31 if (bbGetInputIn()!=NULL){
32 if (imgConnfilter) {imgConnfilter->Delete();}
33 imgConnfilter=vtkImageConnectivityFilter::New();
34 imgConnfilter->SetInputData( bbGetInputIn() );
35 if (bbGetInputExtractionMode()==0) // LargestRegion
37 imgConnfilter->SetExtractionModeToLargestRegion();
40 if (bbGetInputExtractionMode()==1) // AllRegions
42 printf("EED Warning!!!! ImageConnectivityFilter - AllRegions Not Implemented\n ");
44 if (bbGetInputExtractionMode()==2) // SeededRegions
46 printf("EED Warning!!!! ImageConnectivityFilter - SeededRegions Not Implemented\n ");
49 if (bbGetInputScalarRange().size()==2)
51 imgConnfilter->SetScalarRange( bbGetInputScalarRange()[0], bbGetInputScalarRange()[1] );
53 imgConnfilter->Update();
54 bbSetOutputOut( imgConnfilter->GetOutput() );
56 printf("EED Warning!!!! ImageConnectivityFilter - Input image not defined.\n ");
61 // 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)
63 void ImageConnectivityFilter::bbUserSetDefaultValues()
66 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
67 // Here we initialize the input 'In' to 0
69 // bbSetInputScalarRange();
71 bbSetInputExtractionMode(0);
75 // 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)
77 void ImageConnectivityFilter::bbUserInitializeProcessing()
80 // THE INITIALIZATION METHOD BODY :
82 // but this is where you should allocate the internal/output pointers
88 // 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)
90 void ImageConnectivityFilter::bbUserFinalizeProcessing()
93 // THE FINALIZATION METHOD BODY :
95 // but this is where you should desallocate the internal/output pointers
100 // EO namespace bbcreaVtk