1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 /*=========================================================================
30 #ifndef __axisExtractor_h
31 #define __axisExtractor_h
39 #include <sys/types.h>
40 #include <sys/timeb.h>
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>
62 class axisExtractor : public vtkPolyDataSource
65 static axisExtractor *New();
66 void PrintSelf(ostream& os, vtkIndent indent);
68 virtual void SetInput(vtkImageData *input);
69 vtkImageData *GetInput();
71 void SetMaxPropRadio(double value);
72 double GetMaxPropRadio();
74 void SetHumbral(double value);
77 void SetMaxPropMasa(double value);
78 double GetMaxPropMasa();
80 void SetMinPropMasa(double value);
81 double GetMinPropMasa();
83 void SetPoint(double puntoactualprov[3] );
85 vtkImageData *GetVolumen();
99 axisExtractor(const axisExtractor&); // Not implemented.
101 void operator=(const axisExtractor&); // Not implemented.
103 void searc(int i, int j, int k );
105 void find_components( );
107 unsigned short maximo();
115 void corte(double punto1[3], double punto2[3], double punto3[3], double centro[3], double radio );
120 void redondear(vtkImageData *data );
124 void copiar(vtkImageData *data, vtkImageData *data2 );
126 double distancia(double a[3], double b[3] );
128 int envolumen(int a[3], vtkImageData *datae );
130 void realtoreal(double a[3], double b[3] );
133 void realtoreal2(double a[3], double b[3] );
135 void realtoindex(double a[3], int b[3] );
139 void indextoreal(int a[3], double b[3] );
142 void indextoreal(double a[3], double b[3] );
148 vtkImageData *dataprov;
149 vtkImageData *datatotal;
152 unsigned char label2;
154 unsigned long vector[50][4] ;
155 unsigned long vectorb[50][4] ;
157 vtkExtractVOI *extrac;
158 vtkImageThreshold *thresh;
160 vtkImageSeedConnectivity *connect;
162 vtkImageResample *resample;
168 vtkCellArray *lineas;
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;