]> Creatis software - creaRigidRegistration.git/blob - lib/MyGridOnImageGenerator.h
Feature #1766 Add licence terms for all files.
[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 "vtkImageData.h"
40
41 //------------------------------------------------------------------------------
42 // Creates a grid over an image. It is usually used to visualized the deformation
43 // field after a non-rigid registration. The contrast in the final image is based
44 // on the maximum and minimum values over the entire image.
45 //------------------------------------------------------------------------------
46 class MyGridOnImageGenerator
47 {
48 public:
49
50         //------------------------------------------------------------
51         //Builder
52         //------------------------------------------------------------
53
54         /*
55          * Class builder
56          * @param nImage is the input image
57          * @param nScpX is the spacing in X direction
58          * @param nScpY is the spacing in Y direction
59          * @param nScpZ is the spacing in Z direction
60          */
61         MyGridOnImageGenerator(vtkImageData* nImage, double nScpX, double nScpY, double nScpZ);
62
63         //------------------------------------------------------------
64         //Destructor
65         //------------------------------------------------------------
66
67         ~MyGridOnImageGenerator();
68
69         //------------------------------------------------------------
70         //Public methods
71         //------------------------------------------------------------
72
73         /*
74          * Method that changes the spacing in X
75          * param nScpX the new value for the spacing in X
76          */
77         void setScpX(double nScpX);
78
79         /*
80          * Method that changes the spacing in Y
81          * param nScpY the new value for the spacing in Y
82          */
83         void setScpY(double nScpY);
84
85
86         /*
87          * Method that changes the spacing in Z
88          * param nScpZ the new value for the spacing in Z
89          */
90         void setScpZ(double nScpZ);
91
92         /*
93          * Method that changes the input image
94          * @param nImage is the new image
95          */
96         void setImage(vtkImageData* nImage);
97
98         /**
99          * Method that generates the image with the grid
100          * @return The image with the grid
101          */
102         vtkImageData* getGridOnImage( );
103
104 private:
105
106         //------------------------------------------------------------
107         //Private methods
108         //------------------------------------------------------------
109
110
111         //------------------------------------------------------------
112         //Attributes
113         //------------------------------------------------------------
114
115         /*
116          * Spcing in X directioin
117          */
118         double spcX;
119
120         /*
121          * Spcing in Y directioin
122          */
123         double spcY;
124
125         /*
126          * Spcing in Z directioin
127          */
128         double spcZ;
129
130         /**
131          * Input image
132          */
133         vtkImageData* image;
134 };
135
136 //------------------------------------------------------------------------------
137 #endif