--- /dev/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)
+//=====
+#include "bbcreaVtkImageConnectivityFilter.h"
+#include "bbcreaVtkPackage.h"
+
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageConnectivityFilter)
+BBTK_BLACK_BOX_IMPLEMENTATION(ImageConnectivityFilter,bbtk::AtomicBlackBox);
+//=====
+// 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::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+
+ if (bbGetInputIn()!=NULL){
+ if (imgConnfilter) {imgConnfilter->Delete();}
+ imgConnfilter=vtkImageConnectivityFilter::New();
+ imgConnfilter->SetInputData( bbGetInputIn() );
+ if (bbGetInputExtractionMode()==0) // LargestRegion
+ {
+ imgConnfilter->SetExtractionModeToLargestRegion();
+ } // ExtractionMode
+
+ if (bbGetInputExtractionMode()==1) // AllRegions
+ {
+ printf("EED Warning!!!! ImageConnectivityFilter - AllRegions Not Implemented\n ");
+ } // ExtractionMode
+ if (bbGetInputExtractionMode()==2) // SeededRegions
+ {
+ printf("EED Warning!!!! ImageConnectivityFilter - SeededRegions Not Implemented\n ");
+ } // ExtractionMode
+
+ if (bbGetInputScalarRange().size()==2)
+ {
+ imgConnfilter->SetScalarRange( bbGetInputScalarRange()[0], bbGetInputScalarRange()[1] );
+ } // Range
+ imgConnfilter->Update();
+ bbSetOutputOut( imgConnfilter->GetOutput() );
+ } else {
+ 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;
+
+}
+//=====
+// 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
+
+
+}
+//=====
+// 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
+
+
--- /dev/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)
+//=====
+#ifndef __bbcreaVtkImageConnectivityFilter_h_INCLUDED__
+#define __bbcreaVtkImageConnectivityFilter_h_INCLUDED__
+
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include <vtkImageData.h>
+#include <vtkImageConnectivityFilter.h>
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT ImageConnectivityFilter
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ImageConnectivityFilter,bbtk::AtomicBlackBox);
+//=====
+// 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)
+//=====
+ BBTK_DECLARE_INPUT(In,vtkImageData*);
+ BBTK_DECLARE_INPUT(ExtractionMode,int);
+ BBTK_DECLARE_INPUT(ScalarRange,std::vector< double >);
+
+ BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
+ BBTK_PROCESS(Process);
+ void Process();
+
+ vtkImageConnectivityFilter* imgConnfilter;
+//=====
+// 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)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageConnectivityFilter,bbtk::AtomicBlackBox);
+ BBTK_NAME("ImageConnectivityFilter");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+
+ BBTK_INPUT(ImageConnectivityFilter,In,"Input image",vtkImageData*,"");
+ BBTK_INPUT(ImageConnectivityFilter,ExtractionMode,"(default 0) 0=LargestRegion 1=AllRegions 2=SeededRegions",int,"");
+ BBTK_INPUT(ImageConnectivityFilter,ScalarRange,"threshold [Min Max]",std::vector< double >,"");
+
+ BBTK_OUTPUT(ImageConnectivityFilter,Out,"Output image",vtkImageData*,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(ImageConnectivityFilter);
+//=====
+// 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)
+//=====
+}
+// EO namespace bbcreaVtk
+
+#endif // __bbcreaVtkImageConnectivityFilter_h_INCLUDED__
+
--- /dev/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)
+//=====
+#include "bbcreaVtkImageThresholdConnectivity.h"
+#include "bbcreaVtkPackage.h"
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageThresholdConnectivity)
+BBTK_BLACK_BOX_IMPLEMENTATION(ImageThresholdConnectivity,bbtk::AtomicBlackBox);
+//=====
+// 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 ImageThresholdConnectivity::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+
+ printf("EED ImageThresholdConnectivity::Process Error this box is not implemented .... \n");
+ printf("EED ImageThresholdConnectivity::Process Error this box is not implemented .... \n");
+ printf("EED ImageThresholdConnectivity::Process Error this box is not implemented .... \n");
+ printf("EED ImageThresholdConnectivity::Process Error this box is not implemented .... \n");
+}
+//=====
+// 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 ImageThresholdConnectivity::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn(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 ImageThresholdConnectivity::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// 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 ImageThresholdConnectivity::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/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)
+//=====
+#ifndef __bbcreaVtkImageThresholdConnectivity_h_INCLUDED__
+#define __bbcreaVtkImageThresholdConnectivity_h_INCLUDED__
+
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include <vtkImageData.h>
+#include <vtkImageThresholdConnectivity.h>
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT ImageThresholdConnectivity
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ImageThresholdConnectivity,bbtk::AtomicBlackBox);
+//=====
+// 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)
+//=====
+ BBTK_DECLARE_INPUT(In,vtkImageData*);
+ BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// 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)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageThresholdConnectivity,bbtk::AtomicBlackBox);
+ BBTK_NAME("ImageThresholdConnectivity");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("vtkImageThresholdConnectivity");
+ BBTK_CATEGORY("empty");
+
+ BBTK_INPUT(ImageThresholdConnectivity,In,"Input image",vtkImageData*,"");
+
+ BBTK_OUTPUT(ImageThresholdConnectivity,Out,"Output image",vtkImageData*,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(ImageThresholdConnectivity);
+//=====
+// 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)
+//=====
+}
+// EO namespace bbcreaVtk
+
+#endif // __bbcreaVtkImageThresholdConnectivity_h_INCLUDED__
+
--- /dev/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)
+//=====
+#include "bbcreaVtkLstOfVoxels.h"
+#include "bbcreaVtkPackage.h"
+
+#include "creaVtk_MACROS.h"
+
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,LstOfVoxels)
+BBTK_BLACK_BOX_IMPLEMENTATION(LstOfVoxels,bbtk::AtomicBlackBox);
+//=====
+// 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 LstOfVoxels::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+ if (bbGetInputIn()!=NULL)
+ {
+ DEF_POINTER_IMAGE_VTK_CREA(vIn,ssIn,pIn,stIn,bbGetInputIn()) \
+ std::vector<int> lstX;
+ std::vector<int> lstY;
+ std::vector<int> lstZ;
+ std::vector<double> lstValues;
+ int ext[6];
+ bbGetInputIn()->GetExtent(ext);
+ int dim[3];
+ dim[0]=ext[1]-ext[0]+1;
+ dim[1]=ext[3]-ext[2]+1;
+ dim[2]=ext[5]-ext[4]+1;
+ int i,j,k;
+ long int index=0;
+
+
+ int rangeType=0;
+ if (bbGetInputRange().size()==2)
+ {
+ rangeType=1;
+ }
+ bool addPoint;
+
+
+ for (k=0 ; k<dim[2] ; k++)
+ {
+ for (j=0 ; j<dim[1] ; j++)
+ {
+ for (i=0 ; i<dim[0] ; i++)
+ {
+ addPoint=false;
+ GETVALUE2_VTK_CREA(vIn,pIn,stIn,index)
+ if (rangeType==0)
+ {
+ if (vIn!=0)
+ {
+ addPoint=true;
+ } // if vIn ==0
+ } else {
+ if ( (vIn>=bbGetInputRange()[0]) && (vIn<=bbGetInputRange()[1]) )
+ {
+ addPoint=true;
+ } // if vIn ==0
+ } // if rangeType
+
+
+ if (addPoint==true)
+ {
+ lstX.push_back(i);
+ lstY.push_back(j);
+ lstZ.push_back(k);
+ lstValues.push_back(vIn);
+ } // if vIn ==0
+
+ index++;
+ } // for i
+ } // for j
+ } // for k
+ bbSetOutputLstX( lstX );
+ bbSetOutputLstY( lstY );
+ bbSetOutputLstZ( lstZ );
+ bbSetOutputLstValues( lstValues );
+ } else {
+ printf("EED Warning!! LstOfVoxels image not set.\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 LstOfVoxels::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn(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 LstOfVoxels::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// 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 LstOfVoxels::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/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)
+//=====
+#ifndef __bbcreaVtkLstOfVoxels_h_INCLUDED__
+#define __bbcreaVtkLstOfVoxels_h_INCLUDED__
+
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vector"
+#include "vtkImageData.h"
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT LstOfVoxels
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(LstOfVoxels,bbtk::AtomicBlackBox);
+//=====
+// 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)
+//=====
+ BBTK_DECLARE_INPUT(In,vtkImageData*);
+ BBTK_DECLARE_INPUT(Range,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(LstX,std::vector<int>);
+ BBTK_DECLARE_OUTPUT(LstY,std::vector<int>);
+ BBTK_DECLARE_OUTPUT(LstZ,std::vector<int>);
+ BBTK_DECLARE_OUTPUT(LstValues,std::vector<double>);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// 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)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(LstOfVoxels,bbtk::AtomicBlackBox);
+ BBTK_NAME("LstOfVoxels");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(LstOfVoxels,In,"Input image",vtkImageData*,"");
+ BBTK_INPUT(LstOfVoxels,Range,"Threshold [Min Max]",std::vector<double>,"");
+ BBTK_OUTPUT(LstOfVoxels,LstX,"List of x points",std::vector<int>,"");
+ BBTK_OUTPUT(LstOfVoxels,LstY,"List of y points",std::vector<int>,"");
+ BBTK_OUTPUT(LstOfVoxels,LstZ,"List of z points",std::vector<int>,"");
+ BBTK_OUTPUT(LstOfVoxels,LstValues,"List of z points",std::vector<double>,"");
+BBTK_END_DESCRIBE_BLACK_BOX(LstOfVoxels);
+//=====
+// 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)
+//=====
+}
+// EO namespace bbcreaVtk
+
+#endif // __bbcreaVtkLstOfVoxels_h_INCLUDED__
+