]> Creatis software - creaRigidRegistration.git/blob - lib/Substraction.h
*** empty log message ***
[creaRigidRegistration.git] / lib / Substraction.h
1 #include "vtkImageData.h"
2
3 #include <string>
4 #include <vector>
5
6 class Substraction 
7 {
8
9         //----------------------------------------------------------------------------------------
10         // Methods definition
11         //----------------------------------------------------------------------------------------
12         public:
13         //--------------------------
14         //Constructor & Destructor
15         //--------------------------            
16                 Substraction(vtkImageData* imageData1, vtkImageData* imageData2, int uZLevel,int lZLevel, std::vector<double> uColor, std::vector<double> lColor, std::vector<double> mColor);
17                 ~Substraction();
18         //--------------------------
19         //Methods
20         //--------------------------
21                 /*
22                 getting ready the points
23                 */
24                 void initialize(int dimensions[],double spacing[]);
25                 /*
26                 Calculate the new image and save it in the attribute imageResult
27                 it is used if the user had given the imageData
28                 */
29                 void substractImage(vtkImageData* imageData1, vtkImageData* imageData2);
30                 
31                 /*
32                 Returns the ImageResult
33                 */
34                 vtkImageData* getSubstractedImage();
35                 
36                 /*
37                  Get Image Size
38                 */
39                 int getImageSize();
40                 
41                 /*
42                 constructing image substract
43                 */
44                 void substract(vtkImageData* imageData1, vtkImageData* imageData2);
45
46                 /*
47                 Template method of substract for different image types
48                 */
49                 template <class T> void substractByType(T* dataImagePointer1, T* dataImagePointer2, T* dataImageResultPointer, vtkImageData *imageData1, vtkImageData *imageData2);
50                 
51
52
53         //----------------------------------------------------------------------------------------
54         // Attributes declaration
55         //----------------------------------------------------------------------------------------
56         private: 
57                 /*
58                  Substracted Image
59                 */
60                 vtkImageData* imageResult;
61                 /*
62                  image size dimx*dimy*dimz
63                 */
64                 int sizeImage;
65                 /*
66                 upper zero level for doing the Substraction
67                 */
68                 int uZeroLevel;
69                 /*
70                 lower zero level for doing the Substraction
71                 */
72                 int lZeroLevel;
73                 /*
74                 Color for the upper threshold
75                 */
76                 int upperColor[3];
77                 /*
78                 Color for the lower threshold
79                 */
80                 int lowerColor[3];
81                 /*
82                 Color for the medium threshold
83                 */
84                 int mediumColor[3];
85                 /*
86                 Image type
87                 */
88                 int imageType;
89 };
90