1 #ifndef __bbPackRecalageImageSubstraction_h_INCLUDED__
2 #define __bbPackRecalageImageSubstraction_h_INCLUDED__
3 #include "bbPackRecalage_EXPORT.h"
4 #include "bbtkAtomicBlackBox.h"
6 #include "vtkImageData.h"
12 namespace bbPackRecalage
15 class MyImageSubstraction
18 //----------------------------------------------------------------------------------------
20 //----------------------------------------------------------------------------------------
22 //--------------------------
23 //Constructor & Destructor
24 //--------------------------
25 MyImageSubstraction(vtkImageData* imageData1, vtkImageData* imageData2, int uZLevel,int lZLevel, std::vector<double> uColor, std::vector<double> lColor, std::vector<double> mColor);
26 ~MyImageSubstraction();
27 //--------------------------
29 //--------------------------
31 getting ready the points
33 void initialize(int dimensions[],double spacing[]);
35 Calculate the new image and save it in the attribute imageResult
36 it is used if the user had given the imageData
38 void substractImage(vtkImageData* imageData1, vtkImageData* imageData2);
41 Returns the ImageResult
43 vtkImageData* getSubstractedImage();
51 constructing image substract
53 void substract(vtkImageData* imageData1, vtkImageData* imageData2);
57 //----------------------------------------------------------------------------------------
58 // Attributes declaration
59 //----------------------------------------------------------------------------------------
64 vtkImageData* imageResult;
66 image size dimx*dimy*dimz
70 upper zero level for doing the Substraction
74 lower zero level for doing the Substraction
78 Color for the upper threshold
82 Color for the lower threshold
86 Color for the medium threshold
91 class bbPackRecalage_EXPORT ImageSubstraction
93 public bbtk::AtomicBlackBox
95 BBTK_BLACK_BOX_INTERFACE(ImageSubstraction,bbtk::AtomicBlackBox);
96 BBTK_DECLARE_INPUT(In1,vtkImageData*);
97 BBTK_DECLARE_INPUT(In2,vtkImageData*);
98 BBTK_DECLARE_INPUT(In3,int);
99 BBTK_DECLARE_INPUT(In4,int);
100 BBTK_DECLARE_INPUT(InU,std::vector<double>);
101 BBTK_DECLARE_INPUT(InM,std::vector<double>);
102 BBTK_DECLARE_INPUT(InL,std::vector<double>);
103 BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
104 BBTK_PROCESS(Process);
108 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageSubstraction,bbtk::AtomicBlackBox);
109 BBTK_NAME("ImageSubstraction");
110 BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
111 BBTK_DESCRIPTION("Creates a image resulting from the substraction of the RGB values of 2 other images.");
112 BBTK_CATEGORY("__CATEGORY__");
113 BBTK_INPUT(ImageSubstraction,In1,"Image 1",vtkImageData*,"");
114 BBTK_INPUT(ImageSubstraction,In2,"Image 2",vtkImageData*,"");
115 BBTK_INPUT(ImageSubstraction,In3,"Upper Zero Level (Value between 0 and 255)",int,"");
116 BBTK_INPUT(ImageSubstraction,In4,"Lower Zero Level (Value between 0 and 255)",int,"");
117 BBTK_INPUT(ImageSubstraction,InU,"Upper Level Color (RGB)",std::vector<double>,"");
118 BBTK_INPUT(ImageSubstraction,InM,"Medium Level Color (RGB)",std::vector<double>,"");
119 BBTK_INPUT(ImageSubstraction,InL,"Lower Level Color (RGB)",std::vector<double>,"");
120 BBTK_OUTPUT(ImageSubstraction,Out,"Image Result",vtkImageData*,"");
121 BBTK_END_DESCRIBE_BLACK_BOX(ImageSubstraction);
123 // EO namespace bbCreaRecalage
125 #endif // __bbCreaRecalageImageSubstraction_h_INCLUDED__