]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/include/axisExtractor.h
b06a57dc5be1fed22f3621d26940fbb1ccf73782
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / include / axisExtractor.h
1 /*=========================================================================
2
3   */
4
5 #ifndef __axisExtractor_h
6 #define __axisExtractor_h
7
8
9
10 #include <list>
11 #include <stack>
12 #include <time.h>
13 #include <stdio.h>
14 #include <sys/types.h>
15 #include <sys/timeb.h>
16 #include <string.h>
17
18
19
20 #include <vtkPolyDataSource.h>
21 #include <vtkImageThreshold.h>
22 #include <vtkImageCast.h>
23 #include <vtkImageSeedConnectivity.h>
24 #include <vtkImageData.h>
25 #include <vtkMarchingCubes.h>
26 #include <vtkDoubleArray.h>
27 #include <vtkPointData.h>
28 #include <vtkExtractVOI.h>
29 #include <vtkPoints.h>
30 #include <vtkCellArray.h>
31 #include <vtkImageResample.h>
32
33
34
35
36
37 class  axisExtractor : public vtkPolyDataSource
38 {
39 public:
40         static axisExtractor *New();
41         void PrintSelf(ostream& os, vtkIndent indent);
42
43         virtual void SetInput(vtkImageData *input);
44         vtkImageData *GetInput();
45
46         void SetMaxPropRadio(double value);
47         double GetMaxPropRadio();
48
49         void SetHumbral(double value);
50         double GetHumbral();
51
52         void SetMaxPropMasa(double value);
53         double GetMaxPropMasa();
54
55         void SetMinPropMasa(double value);
56         double GetMinPropMasa();
57
58         void SetPoint(double puntoactualprov[3] );
59
60         vtkImageData *GetVolumen();
61
62   
63   
64 protected:  
65         axisExtractor();
66         
67         ~axisExtractor() {};
68
69         void Execute();
70  
71   
72
73 private:
74         axisExtractor(const axisExtractor&);  // Not implemented.
75
76         void operator=(const axisExtractor&);  // Not implemented.
77   
78         void searc(int i, int j, int k );
79
80         void find_components( );
81
82         unsigned short maximo();
83
84         void blanquear();
85
86         void blanquear2();
87
88         
89         
90         void corte(double punto1[3], double punto2[3], double punto3[3], double centro[3],  double radio );
91
92         void avanzar();
93
94         
95         void redondear(vtkImageData *data );
96
97         
98         
99         void copiar(vtkImageData *data, vtkImageData *data2 );
100
101         double distancia(double a[3], double b[3] );    
102         
103         int envolumen(int a[3], vtkImageData *datae );
104
105         void realtoreal(double a[3], double b[3] );
106
107
108         void realtoreal2(double a[3], double b[3] );
109
110         void realtoindex(double a[3], int b[3] );
111
112
113
114         void indextoreal(int a[3], double b[3] );
115
116
117         void indextoreal(double a[3], double b[3] );
118
119         
120
121
122
123         vtkImageData *dataprov;
124         vtkImageData *datatotal;
125         
126         unsigned char label;
127         unsigned char label2;
128
129         unsigned long vector[50][4] ;
130         unsigned long vectorb[50][4] ;
131
132         vtkExtractVOI *extrac;
133         vtkImageThreshold *thresh;
134         vtkImageCast *cast;
135         vtkImageSeedConnectivity *connect;
136
137         vtkImageResample *resample;
138         
139         int iter;
140
141         vtkPoints *points;
142
143         vtkCellArray *lineas; 
144
145         double humbral;
146         double maxpropradio;
147         double maxpropmasa;
148         double minpropmasa; 
149
150         int buenos;
151
152         std::stack< double  >                                           m_Stack0;
153         std::stack< double  >                                           m_Stack1;
154         std::stack< double  >                                           m_Stack2;
155         std::stack< double  >                                           m_Stack3;
156         std::stack< double  >                                           m_Stack4;
157         std::stack< double  >                                           m_Stack5;
158         std::stack< int  >                                              m_Stack;
159
160         int flagg;
161         
162 };
163
164 #endif
165
166