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 "bbvtkImageBoundaries.h"
5 #include "bbvtkPackage.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ImageBoundaries)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ImageBoundaries,bbtk::AtomicBlackBox);
12 // 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)
14 void ImageBoundaries::Process()
16 printf("bbtk:vtk::ImageBoundaries::Process start\n");
17 if (bbGetInputIn()!=NULL){
22 bbGetInputIn()->GetWholeExtent(ext);
23 int maxX = ext[1]-ext[0]+1;
24 int maxY = ext[3]-ext[2]+1;
25 int maxZ = ext[5]-ext[4]+1;
34 for (i=0 ; i<maxX ; i++)
36 for (j=0 ; j<maxY ; j++)
38 for (k=0 ; k<maxZ ; k++)
40 value = bbGetInputIn()->GetScalarComponentAsDouble(i, j, k,0);
41 if ( (value>=bbGetInputLowerValue()) && (value<=bbGetInputUpperValue()) )
54 std::vector<int> tmpIndex;
55 std::vector<int> tmpSize;
58 tmpIndex.push_back(0);
59 tmpIndex.push_back(0);
60 tmpIndex.push_back(0);
65 tmpIndex.push_back(bXMin);
66 tmpIndex.push_back(bYMin);
67 tmpIndex.push_back(bZMin);
68 tmpSize.push_back(bXMax-bXMin+1);
69 tmpSize.push_back(bYMax-bYMin+1);
70 tmpSize.push_back(bZMax-bZMin+1);
73 bbSetOutputIndex(tmpIndex);
74 bbSetOutputSize(tmpSize);
76 printf("bbtk warnning: bbtk:vtk:ImageBoundaries box, Input image (In) not initialized..\n");
78 printf("bbtk:vtk::ImageBoundaries::Process end\n");
81 // 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)
83 void ImageBoundaries::bbUserSetDefaultValues()
87 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
89 bbSetInputLowerValue(0);
90 bbSetInputUpperValue(5000);
92 std::vector<int> tmpIndex;
93 tmpIndex.push_back(0);
94 tmpIndex.push_back(0);
95 tmpIndex.push_back(0);
97 std::vector<int> tmpSize;
100 tmpSize.push_back(1);
102 bbSetOutputIndex(tmpIndex);
103 bbSetOutputSize(tmpSize);
106 // 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)
108 void ImageBoundaries::bbUserInitializeProcessing()
111 // THE INITIALIZATION METHOD BODY :
113 // but this is where you should allocate the internal/output pointers
119 // 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)
121 void ImageBoundaries::bbUserFinalizeProcessing()
124 // THE FINALIZATION METHOD BODY :
126 // but this is where you should desallocate the internal/output pointers
131 // EO namespace bbvtk