]> Creatis software - creaRigidRegistration.git/blob - lib/MyGridOnImageGenerator.h
Class that generates a grid over an image in order to visualize the deformation field...
[creaRigidRegistration.git] / lib / MyGridOnImageGenerator.h
1 #ifndef __MyGridOnImageGenerator_h__
2 #define __MyGridOnImageGenerator_h__
3
4 //-----------------
5 // C++
6 //-----------------
7
8
9 //-----------------
10 // VTK
11 //-----------------
12
13 #include "vtkImageData.h"
14
15 //------------------------------------------------------------------------------
16 // Creates a grid over an image. It is usually used to visualized the deformation
17 // field after a non-rigid registration. The contrast in the final image is based
18 // on the maximum and minimum values over the entire image.
19 //------------------------------------------------------------------------------
20 class MyGridOnImageGenerator
21 {
22 public:
23
24         //------------------------------------------------------------
25         //Builder
26         //------------------------------------------------------------
27
28         /*
29          * Class builder
30          * @param nImage is the input image
31          * @param nScpX is the spacing in X direction
32          * @param nScpY is the spacing in Y direction
33          * @param nScpZ is the spacing in Z direction
34          */
35         MyGridOnImageGenerator(vtkImageData* nImage, double nScpX, double nScpY, double nScpZ);
36
37         //------------------------------------------------------------
38         //Destructor
39         //------------------------------------------------------------
40
41         ~MyGridOnImageGenerator();
42
43         //------------------------------------------------------------
44         //Public methods
45         //------------------------------------------------------------
46
47         /*
48          * Method that changes the spacing in X
49          * param nScpX the new value for the spacing in X
50          */
51         void setScpX(double nScpX);
52
53         /*
54          * Method that changes the spacing in Y
55          * param nScpY the new value for the spacing in Y
56          */
57         void setScpY(double nScpY);
58
59
60         /*
61          * Method that changes the spacing in Z
62          * param nScpZ the new value for the spacing in Z
63          */
64         void setScpZ(double nScpZ);
65
66         /*
67          * Method that changes the input image
68          * @param nImage is the new image
69          */
70         void setImage(vtkImageData* nImage);
71
72         /**
73          * Method that generates the image with the grid
74          * @return The image with the grid
75          */
76         vtkImageData* getGridOnImage( );
77
78 private:
79
80         //------------------------------------------------------------
81         //Private methods
82         //------------------------------------------------------------
83
84
85         //------------------------------------------------------------
86         //Attributes
87         //------------------------------------------------------------
88
89         /*
90          * Spcing in X directioin
91          */
92         double spcX;
93
94         /*
95          * Spcing in Y directioin
96          */
97         double spcY;
98
99         /*
100          * Spcing in Z directioin
101          */
102         double spcZ;
103
104         /**
105          * Input image
106          */
107         vtkImageData* image;
108 };
109
110 //------------------------------------------------------------------------------
111 #endif