]> Creatis software - creaRigidRegistration.git/blob - lib/Substraction.h
Feature #1766 Add licence terms for all files.
[creaRigidRegistration.git] / lib / Substraction.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 #include "vtkImageData.h"
28
29 #include <string>
30 #include <vector>
31
32 class Substraction 
33 {
34
35         //----------------------------------------------------------------------------------------
36         // Methods definition
37         //----------------------------------------------------------------------------------------
38         public:
39         //--------------------------
40         //Constructor & Destructor
41         //--------------------------            
42                 Substraction(vtkImageData* imageData1, vtkImageData* imageData2, int uZLevel,int lZLevel, std::vector<double> uColor, std::vector<double> lColor, std::vector<double> mColor);
43                 ~Substraction();
44         //--------------------------
45         //Methods
46         //--------------------------
47                 /*
48                 getting ready the points
49                 */
50                 void initialize(int dimensions[],double spacing[]);
51                 /*
52                 Calculate the new image and save it in the attribute imageResult
53                 it is used if the user had given the imageData
54                 */
55                 void substractImage(vtkImageData* imageData1, vtkImageData* imageData2);
56                 
57                 /*
58                 Returns the ImageResult
59                 */
60                 vtkImageData* getSubstractedImage();
61                 
62                 /*
63                  Get Image Size
64                 */
65                 int getImageSize();
66                 
67                 /*
68                 constructing image substract
69                 */
70                 void substract(vtkImageData* imageData1, vtkImageData* imageData2);
71
72                 /*
73                 Template method of substract for different image types
74                 */
75                 template <class T> void substractByType(T* dataImagePointer1, T* dataImagePointer2, T* dataImageResultPointer, vtkImageData *imageData1, vtkImageData *imageData2);
76                 
77
78
79         //----------------------------------------------------------------------------------------
80         // Attributes declaration
81         //----------------------------------------------------------------------------------------
82         private: 
83                 /*
84                  Substracted Image
85                 */
86                 vtkImageData* imageResult;
87                 /*
88                  image size dimx*dimy*dimz
89                 */
90                 int sizeImage;
91                 /*
92                 upper zero level for doing the Substraction
93                 */
94                 int uZeroLevel;
95                 /*
96                 lower zero level for doing the Substraction
97                 */
98                 int lZeroLevel;
99                 /*
100                 Color for the upper threshold
101                 */
102                 int upperColor[3];
103                 /*
104                 Color for the lower threshold
105                 */
106                 int lowerColor[3];
107                 /*
108                 Color for the medium threshold
109                 */
110                 int mediumColor[3];
111                 /*
112                 Image type
113                 */
114                 int imageType;
115 };
116