]> Creatis software - creaRigidRegistration.git/blob - lib/MyGridOnImageGenerator.h
#3466 vtk9itk5wx3-macos
[creaRigidRegistration.git] / lib / MyGridOnImageGenerator.h
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5 #                        pour la Santé)
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 #
10 #  This software is governed by the CeCILL-B license under French law and 
11 #  abiding by the rules of distribution of free software. You can  use, 
12 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
13 #  license as circulated by CEA, CNRS and INRIA at the following URL 
14 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
15 #  or in the file LICENSE.txt.
16 #
17 #  As a counterpart to the access to the source code and  rights to copy,
18 #  modify and redistribute granted by the license, users are provided only
19 #  with a limited warranty  and the software's author,  the holder of the
20 #  economic rights,  and the successive licensors  have only  limited
21 #  liability. 
22 #
23 #  The fact that you are presently reading this means that you have had
24 #  knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------      */                                                                    
26
27 #ifndef __MyGridOnImageGenerator_h__
28 #define __MyGridOnImageGenerator_h__
29
30 //-----------------
31 // C++
32 //-----------------
33
34
35 //-----------------
36 // VTK
37 //-----------------
38
39 #include <vtkVersionMacros.h>
40 #include "vtkImageData.h"
41
42 //------------------------------------------------------------------------------
43 // Creates a grid over an image. It is usually used to visualized the deformation
44 // field after a non-rigid registration. The contrast in the final image is based
45 // on the maximum and minimum values over the entire image.
46 //------------------------------------------------------------------------------
47 class MyGridOnImageGenerator
48 {
49 public:
50
51         //------------------------------------------------------------
52         //Builder
53         //------------------------------------------------------------
54
55         /*
56          * Class builder
57          * @param nImage is the input image
58          * @param nScpX is the spacing in X direction
59          * @param nScpY is the spacing in Y direction
60          * @param nScpZ is the spacing in Z direction
61          */
62         MyGridOnImageGenerator(vtkImageData* nImage, double nScpX, double nScpY, double nScpZ);
63
64         //------------------------------------------------------------
65         //Destructor
66         //------------------------------------------------------------
67
68         ~MyGridOnImageGenerator();
69
70         //------------------------------------------------------------
71         //Public methods
72         //------------------------------------------------------------
73
74         /*
75          * Method that changes the spacing in X
76          * param nScpX the new value for the spacing in X
77          */
78         void setScpX(double nScpX);
79
80         /*
81          * Method that changes the spacing in Y
82          * param nScpY the new value for the spacing in Y
83          */
84         void setScpY(double nScpY);
85
86
87         /*
88          * Method that changes the spacing in Z
89          * param nScpZ the new value for the spacing in Z
90          */
91         void setScpZ(double nScpZ);
92
93         /*
94          * Method that changes the input image
95          * @param nImage is the new image
96          */
97         void setImage(vtkImageData* nImage);
98
99         /**
100          * Method that generates the image with the grid
101          * @return The image with the grid
102          */
103         vtkImageData* getGridOnImage( );
104
105 private:
106
107         //------------------------------------------------------------
108         //Private methods
109         //------------------------------------------------------------
110
111
112         //------------------------------------------------------------
113         //Attributes
114         //------------------------------------------------------------
115
116         /*
117          * Spcing in X directioin
118          */
119         double spcX;
120
121         /*
122          * Spcing in Y directioin
123          */
124         double spcY;
125
126         /*
127          * Spcing in Z directioin
128          */
129         double spcZ;
130
131         /**
132          * Input image
133          */
134         vtkImageData* image;
135 };
136
137 //------------------------------------------------------------------------------
138 #endif