]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/Contour/Propagation.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / Contour / Propagation.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 #ifndef __Propagation_h_INCLUDED__
27 #define __Propagation_h_INCLUDED__
28
29 #include "vtkImageData.h"
30
31 /* EED 03/07/2008
32   #include "itkMatrix.h"
33 */
34
35 #include "marTypes.h"
36 #include "manualContourModel.h"
37 #include "time.h"
38 #include <wx/wx.h>
39
40 class Vector
41 {
42         public:
43                         Vector  ();
44                         ~Vector ();
45             void        set_vec         ( double val );
46                         void    set_var         ( double val );
47                         double  get_vec         ( int id );
48                         double  get_var         ( );
49                         int             getsize_vec     ( );
50                         void    copyVector      ( std::vector<Vector>*vec1, std::vector<Vector>*vec2 ); 
51                         void    printVector     ( std::vector<Vector>*vec1 );
52                         void    set_x           ( double val );
53                         void    set_y           ( double val );
54                         void    set_z           ( double val );
55                         void    set_plane       ( int val );
56                         double  get_x           ( int id );
57                         int             getsize_x       ( );
58                         double  get_y           ( int id );
59                         int             getsize_y       ( );
60                         double  get_z           ( int id );
61                         int             getsize_z       ( );
62                         int             get_plane       ( );
63                         void    resetVec        ( );
64                         std::vector<double>     getVec();
65
66         private:
67                         double _var;
68                         int _plane;
69                         std::vector<double> _vec;
70                         std::vector<double> _vecX;
71                         std::vector<double> _vecY;
72                         std::vector<double> _vecZ;
73 };
74
75 class creaMaracasVisu_EXPORT PropContour
76 {
77         public:
78                         PropContour();
79                         ~PropContour();
80
81 /* EED 03/07/2008
82                         vtkImageData*   method_RBF                                      ( double rad, std::vector<double>*CoordX, std::vector<double>*CoordY, 
83                                                                                                                   std::vector<double>*CoordZ );
84                         vtkImageData*   method_RBF_3D                           ( double rad, std::vector<double>*CoordX, std::vector<double>*CoordY, 
85                                                                                                                   std::vector<double>*CoordZ );
86                         vtkImageData*   method_RBF_3D_ThinPlate         ( double rad, std::vector<double>*CoordX, std::vector<double>*CoordY, 
87                                                                                                                   std::vector<double>*CoordZ );
88 */
89
90                         int                             VectorDirection                         ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
91                         void                    VectorOrder                                     ( int dir, int posinic, std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ);
92                         void                    ReadKeyContour                          ( FILE* fd );
93                         void                    ResetKeyContours                        ( );
94                         void                    SetKeyContours                          ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
95                         vtkImageData*   CalculeSplinePropagation        (  );  
96                         void                    GetKeyContours                          ( std::vector<double>*KeyX, std::vector<double>*KeyY, std::vector<double>*KeyZ, std::vector<int>*KeyS );
97                         void                    GetPropagatedContours           ( std::vector<Vector>*planevec );
98                         void                    GetIdContour                            ( int id, std::vector<double>*vecX, std::vector<double>*vecY, std::vector<double>*vecZ );
99                         void                    SetInterpNumber                         ( int val );
100                         int                             FindIdWithZ                                     ( double z );
101
102         private:
103
104 /* EED 03/07/2008
105                         double                  RBF_WendLand                            ( double norm, double m_rad );
106                         double                  RBF_ThinPlate                           ( double norm );
107                         double                  RBF_ThinPlate_3D                        ( double norm );
108 */
109
110                         void                    PreparePointsForSpline          ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ, std::vector<int>*Sizes );
111                         vtkImageData*   method_Spline                           ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ, std::vector<int>*Sizes );
112                         void                    ResetPlaneVector();
113                         
114                         int                                             _interpnumber;
115
116                         int                                             _dimImage[3];
117                         vtkImageData                    *imagedataValue;
118                         manualContourModel              *_mContourModel;
119
120                         std::vector<double>             _KeyContourX;
121                         std::vector<double>             _KeyContourY;
122                         std::vector<double>             _KeyContourZ;
123                         std::vector<int>                _KeyContourSizes;
124
125                         std::vector<Vector>             _planevector;
126 };
127 #endif // __Propagation_h_INCLUDED__
128  
129