]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/include/axisExtractor.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / include / axisExtractor.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 /*=========================================================================
27
28   */
29
30 #ifndef __axisExtractor_h
31 #define __axisExtractor_h
32
33
34
35 #include <list>
36 #include <stack>
37 #include <time.h>
38 #include <stdio.h>
39 #include <sys/types.h>
40 #include <sys/timeb.h>
41 #include <string.h>
42
43
44
45 #include <vtkPolyDataSource.h>
46 #include <vtkImageThreshold.h>
47 #include <vtkImageCast.h>
48 #include <vtkImageSeedConnectivity.h>
49 #include <vtkImageData.h>
50 #include <vtkMarchingCubes.h>
51 #include <vtkDoubleArray.h>
52 #include <vtkPointData.h>
53 #include <vtkExtractVOI.h>
54 #include <vtkPoints.h>
55 #include <vtkCellArray.h>
56 #include <vtkImageResample.h>
57
58
59
60
61
62 class  axisExtractor : public vtkPolyDataSource
63 {
64 public:
65         static axisExtractor *New();
66         void PrintSelf(ostream& os, vtkIndent indent);
67
68         virtual void SetInput(vtkImageData *input);
69         vtkImageData *GetInput();
70
71         void SetMaxPropRadio(double value);
72         double GetMaxPropRadio();
73
74         void SetHumbral(double value);
75         double GetHumbral();
76
77         void SetMaxPropMasa(double value);
78         double GetMaxPropMasa();
79
80         void SetMinPropMasa(double value);
81         double GetMinPropMasa();
82
83         void SetPoint(double puntoactualprov[3] );
84
85         vtkImageData *GetVolumen();
86
87   
88   
89 protected:  
90         axisExtractor();
91         
92         ~axisExtractor() {};
93
94         void Execute();
95  
96   
97
98 private:
99         axisExtractor(const axisExtractor&);  // Not implemented.
100
101         void operator=(const axisExtractor&);  // Not implemented.
102   
103         void searc(int i, int j, int k );
104
105         void find_components( );
106
107         unsigned short maximo();
108
109         void blanquear();
110
111         void blanquear2();
112
113         
114         
115         void corte(double punto1[3], double punto2[3], double punto3[3], double centro[3],  double radio );
116
117         void avanzar();
118
119         
120         void redondear(vtkImageData *data );
121
122         
123         
124         void copiar(vtkImageData *data, vtkImageData *data2 );
125
126         double distancia(double a[3], double b[3] );    
127         
128         int envolumen(int a[3], vtkImageData *datae );
129
130         void realtoreal(double a[3], double b[3] );
131
132
133         void realtoreal2(double a[3], double b[3] );
134
135         void realtoindex(double a[3], int b[3] );
136
137
138
139         void indextoreal(int a[3], double b[3] );
140
141
142         void indextoreal(double a[3], double b[3] );
143
144         
145
146
147
148         vtkImageData *dataprov;
149         vtkImageData *datatotal;
150         
151         unsigned char label;
152         unsigned char label2;
153
154         unsigned long vector[50][4] ;
155         unsigned long vectorb[50][4] ;
156
157         vtkExtractVOI *extrac;
158         vtkImageThreshold *thresh;
159         vtkImageCast *cast;
160         vtkImageSeedConnectivity *connect;
161
162         vtkImageResample *resample;
163         
164         int iter;
165
166         vtkPoints *points;
167
168         vtkCellArray *lineas; 
169
170         double humbral;
171         double maxpropradio;
172         double maxpropmasa;
173         double minpropmasa; 
174
175         int buenos;
176
177         std::stack< double  >                                           m_Stack0;
178         std::stack< double  >                                           m_Stack1;
179         std::stack< double  >                                           m_Stack2;
180         std::stack< double  >                                           m_Stack3;
181         std::stack< double  >                                           m_Stack4;
182         std::stack< double  >                                           m_Stack5;
183         std::stack< int  >                                              m_Stack;
184
185         int flagg;
186         
187 };
188
189 #endif
190
191