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 "bbcreaVtkLstOfVoxels.h"
5 #include "bbcreaVtkPackage.h"
7 #include "creaVtk_MACROS.h"
12 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,LstOfVoxels)
13 BBTK_BLACK_BOX_IMPLEMENTATION(LstOfVoxels,bbtk::AtomicBlackBox);
15 // 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)
17 void LstOfVoxels::Process()
20 // THE MAIN PROCESSING METHOD BODY
21 // Here we simply set the input 'In' value to the output 'Out'
22 // And print out the output value
23 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
24 // void bbSet{Input|Output}NAME(const TYPE&)
25 // const TYPE& bbGet{Input|Output}NAME() const
27 // * NAME is the name of the input/output
28 // (the one provided in the attribute 'name' of the tag 'input')
29 // * TYPE is the C++ type of the input/output
30 // (the one provided in the attribute 'type' of the tag 'input')
32 if (bbGetInputIn()!=NULL)
34 DEF_POINTER_IMAGE_VTK_CREA(vIn,ssIn,pIn,stIn,bbGetInputIn()) \
35 std::vector<int> lstX;
36 std::vector<int> lstY;
37 std::vector<int> lstZ;
38 std::vector<double> lstValues;
40 bbGetInputIn()->GetExtent(ext);
42 dim[0]=ext[1]-ext[0]+1;
43 dim[1]=ext[3]-ext[2]+1;
44 dim[2]=ext[5]-ext[4]+1;
50 if (bbGetInputRange().size()==2)
57 for (k=0 ; k<dim[2] ; k++)
59 for (j=0 ; j<dim[1] ; j++)
61 for (i=0 ; i<dim[0] ; i++)
64 GETVALUE2_VTK_CREA(vIn,pIn,stIn,index)
72 if ( (vIn>=bbGetInputRange()[0]) && (vIn<=bbGetInputRange()[1]) )
84 lstValues.push_back(vIn);
91 bbSetOutputLstX( lstX );
92 bbSetOutputLstY( lstY );
93 bbSetOutputLstZ( lstZ );
94 bbSetOutputLstValues( lstValues );
96 printf("EED Warning!! LstOfVoxels image not set.\n");
101 // 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)
103 void LstOfVoxels::bbUserSetDefaultValues()
106 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
107 // Here we initialize the input 'In' to 0
112 // 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)
114 void LstOfVoxels::bbUserInitializeProcessing()
117 // THE INITIALIZATION METHOD BODY :
119 // but this is where you should allocate the internal/output pointers
125 // 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)
127 void LstOfVoxels::bbUserFinalizeProcessing()
130 // THE FINALIZATION METHOD BODY :
132 // but this is where you should desallocate the internal/output pointers
137 // EO namespace bbcreaVtk