1 /*=========================================================================
5 #ifndef __axisExtractor02_h
6 #define __axisExtractor02_h
10 #include "vtkCellArray.h"
11 #include "vtkPolyData.h"
12 #include "vtkImageToStructuredPoints.h"
13 #include "vtkImageEuclideanDistance.h"
14 #include "vtkExtractVOI.h"
15 #include "vtkImageThreshold.h"
16 #include "vtkImageCast.h"
17 #include "vtkImageSeedConnectivity.h"
18 #include "vtkImageData.h"
19 #include "vtkImageReslice.h"
20 #include "vtkDoubleArray.h"
21 #include "vtkPointData.h"
22 #include "vtkImageResample.h"
24 #include "vtkPolyDataSource.h"
25 #include "vtkImageConstantPad.h"
35 class axisExtractor02 : public vtkPolyDataSource
38 static axisExtractor02 *New();
39 void PrintSelf(ostream& os, vtkIndent indent);
41 virtual void SetInput(vtkImageData *input);
42 vtkImageData *GetInput();
43 vtkPolyData *GetOutput();
45 void SetParam(double value);
48 void SetParam2(double value);
51 void SetParam3(double value);
55 void SetMaxant(int value);
58 void SetMinant(int value);
61 void SetPoint(double value[3]);
63 vtkImageData *GetVolumen();
65 void distanciaejes(vtkPolyData *eje1, vtkPolyData *eje2);
67 void blanquear(vtkImageData *data );
69 void copiar(vtkImageData *data, vtkImageData *data2 );
84 ~axisExtractor02() {};
91 axisExtractor02(const axisExtractor02&); // Not implemented.
93 void operator=(const axisExtractor02&); // Not implemented.
95 void realtoreal(double a[3], double b[3] );
97 void realtoreal2(double a[3], double b[3] );
99 void realtoindex(double a[3], int b[3] );
101 void indextoreal(int a[3], double b[3] );
103 void indextoreal(double a[3], double b[3] );
105 double distanciaejepunto(double point[3], double point2[3], double point3[3]);
107 double proporcioejepunto(double point[3], double point2[3], double point3[3]);
109 void searc(int i, int j, int k, vtkImageData *data, vtkImageData *data2, unsigned char label, unsigned long vector[50][4] );
111 void searcb(int i, int j, int k, vtkImageData *data, vtkImageData *data2, unsigned char label, unsigned long vector[50][4] );
113 unsigned char find_components(vtkImageData *data, vtkImageData *data2, unsigned char label, unsigned long vector[50][4] );
115 unsigned char find_componentsb(vtkImageData *data, vtkImageData *data2, unsigned char label, unsigned long vector[50][4] );
117 int proporcion(vtkImageData *data );
119 bool border(vtkImageData *data, int p1[3] );
121 void optim(vtkImageData *data, vtkImageData *data2 );
123 void costominimo(vtkImageData *data, vtkImageData *data2 );
125 void costominimo2(vtkImageData *data, vtkImageData *data3, int p1[3], int p2[3], int p3[3]);
127 void invertir(vtkImageData *data );
129 void redondear(vtkImageData *data );
131 void redondear2(vtkImageData *data );
133 void redondear3(vtkImageData *data );
135 double distancia(double a[3], double b[3] );
137 double distancia(int a[3], int b[3] );
139 void blanquear3(vtkImageData *data );
141 void blanquear2(vtkImageData *data );
143 void cilindro(vtkImageData *data, double vector[3] );
145 void modelo(vtkImageData *data, unsigned char cantidad, unsigned long vector[50][4], int candit[10][3], double radioactual, double minis[10]);
147 void comparacion(vtkImageData *data, vtkImageData *data2, unsigned long minis[4]);
149 void copiar2(vtkImageData *data, vtkImageData *data2 );
151 double angulo(double a[3], double b[3] );
153 double angulo(double i1, double j1, double k1, double i2, double j2, double k2 );
155 int envolumen(int a[3], vtkImageData *datae );
157 int mincandit(int candit[10][3], int cantidad, double puntoanterior[3]);
159 int maxareacandit(unsigned long vector[50][4], int cantidad);
161 unsigned long totalarea(unsigned long vector[50][4], unsigned long vectorb[50][4], int cantidad, int cantidadb);
163 unsigned long conecarea(unsigned long vector[50][4], int cantidad);
165 int bruled(int candit[10][3], int cantidad, vtkImageData *data4);
167 double correction(int candit[10][3], int cantidad, vtkImageData *data, int indicecorregido[3], double puntocorregido[3], int indiceanterior[3], double radioanterior, int indicepre[3], double radiopre);
169 double correction2(int candit[10][3], int cantidad, vtkImageData *data, int indicecorregido[3], double puntocorregido[3], int indiceanterior[3], double radioanterior);
190 vtkImageEuclideanDistance *distance;
191 vtkExtractVOI *extrac;
192 vtkImageSeedConnectivity *connect;
193 vtkImageResample *resample;
208 vtkCellArray *lineas;
211 /* std::stack< double > m_Stack0;
212 std::stack< double > m_Stack1;
213 std::stack< double > m_Stack2;
214 std::stack< double > m_Stack3;
215 std::stack< double > m_Stack4;
216 std::stack< double > m_Stack5;
217 std::stack< double > m_Stack6;
218 std::stack< double > m_Stack7;
219 std::stack< double > m_Stack8;
220 std::stack< int > m_Stack;
221 std::stack< double > m_Stackr;
222 std::stack< double > m_Stackra;
223 std::stack< double > m_Stackrp;*/
226 std::deque< double > m_Stack0;
227 std::deque< double > m_Stack1;
228 std::deque< double > m_Stack2;
229 std::deque< double > m_Stack3;
230 std::deque< double > m_Stack4;
231 std::deque< double > m_Stack5;
232 std::deque< double > m_Stack6;
233 std::deque< double > m_Stack7;
234 std::deque< double > m_Stack8;
235 std::deque< int > m_Stack;
236 std::deque< double > m_Stackr;
237 std::deque< double > m_Stackra;
238 std::deque< double > m_Stackrp;
242 double puntoanteriorr[3];
286 unsigned int hist[2000];
291 double variance, maxVariance, zerothCumuMoment, firstCumuMoment ;
292 double variance2, maxVariance2, zerothCumuMoment2, firstCumuMoment2 ;
293 double variance3, maxVariance3, zerothCumuMoment3, firstCumuMoment3 ;
294 double firstCumuMomentb, firstCumuMomentb2, firstCumuMomentb3 ;
299 int thresholdPoint, thresholdPoint1, thresholdPoint2;
313 double centx, centy, centz;
314 double centx2, centy2, centz2;
316 double centix, centiy, centiz;
330 double centxp, centyp, centzp;
331 double centx2p, centy2p, centz2p;
333 double centixp, centiyp, centizp;
335 double costo, costop;
344 double inerciar, inerciarp, inerciari, inerciary, inerciarz, inerciariy, inerciariz, inerciarpy, inerciarpz;
346 double inercia2r, inercia2rp;
355 double visitedrad[10];