]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / Contour / ContourCrownWidget.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 __ContourCrownWidget_h_INCLUDED_H__
27 #define __ContourCrownWidget_h_INCLUDED_H__
28
29 #include "marTypes.h"
30 #include "manualContourControler.h"
31 #include "manualContourModel.h"
32 #include "manualViewContour.h"
33 #include "manualRoiControler.h"
34 #include "manualViewRoi.h"
35 #include "mBarRange.h"
36
37 //JSTG_14-06-08--------------------
38 #include "ContourPropagation.h"
39 //---------------------------------
40   
41
42
43   //--------------------------------------------------------------------------
44   class creaMaracasVisu_EXPORT wxMaracasCoutourTool : public wxPanel
45   {
46   public:
47         wxMaracasCoutourTool( wxWindow *parent);
48     ~wxMaracasCoutourTool();
49         void OnContourA(wxCommandEvent &event);   
50         void OnContourB(wxCommandEvent &event);   
51         void OnContourAB(wxCommandEvent &event);   
52
53           void Init(wxVtkBaseView *wxvtkbaseview, vtkImageData* imagedata);
54           void ConfigureVTK();
55
56         void GetValuesInsideCrown(      std::vector<double> *pLstValue,
57                                                                 std::vector<double> *pLstValuePosX,
58                                                                 std::vector<double> *pLstValuePosY,
59                                                                 std::vector<double> *pLstValuePosZ);
60
61         wxVtkBaseView *GetWxVtkBaseView();
62 //EED   void ProcessOutputs();
63         vtkImageData *GetVtkImageValueResult();
64         vtkImageData *GetVtkImageMaskResult();
65
66 //JSTG 26-02-08 --------------------------------------------------------------------------------------------
67         void GetSplinePoints    (       std::vector<double> *pLstContourX,
68                                                                 std::vector<double> *pLstContourY,
69                                                                 std::vector<double> *pLstContourZ  );
70
71         void SetControlPoints   (       std::vector<double> *InVectorX,
72                                                                 std::vector<double> *InVectorY, 
73                                                                 std::vector<double> *InVectorZ );
74 //JSTG 21-03-08 ----------------------------------------------
75         void OnSaveContour              ( wxCommandEvent &event );
76         void OnSaveControlPoints( wxCommandEvent &event );
77 //JSTG 11-04-08 ----------------------------------------------
78     void EreaseLastContour      ( wxCommandEvent& event );
79         void EreaseLastCP               ( wxCommandEvent& event );
80 //----------------------------------------------------------------------------------------------------------
81
82   private:
83         mBarRange               *mbarrange;
84 //EED   ContourCrown    *mbbtkContourCrown;
85         vtkImageData    *imagedata;
86         vtkImageData    *imagedataValueResult;
87         vtkImageData    *imagedataMaskResult;
88         wxVtkBaseView   *wxvtkbaseview;
89
90 //JSTG 26-02-08 ------------------------------------------
91         std::vector<double>             _tempCX;
92         std::vector<double>             _tempCY;
93         std::vector<int>                _tempCZ;
94         std::vector<int>                _SizesC;
95         std::vector<double>             _tempCPX;
96         std::vector<double>             _tempCPY;
97         std::vector<int>                _tempCPZ;
98         std::vector<int>                _SizesCP;
99         std::vector<double>             *pControlVectorX;
100         std::vector<double>             *pControlVectorY;
101         std::vector<double>             *pControlVectorZ;
102         int _zz;
103         manualPoint                             *_mpoint;
104 //--------------------------------------------------------
105 //JSTG_14-06-08-------------------------------------------
106         ContourPropagation              *_contprop;
107 //--------------------------------------------------------
108
109         manualContourControler  *_manContourControl_1;
110         manualContourModel              *_mContourModel_1;
111         manualViewContour               *_mViewContour_1;
112
113         manualContourControler  *_manContourControl_2;
114         manualContourModel              *_mContourModel_2;
115         manualViewContour               *_mViewContour_2;
116
117         manualRoiControler              *_manRoiControl;
118         manualContourModel              *_mContourModel;
119         manualViewRoi                   *_mViewRoi;
120
121
122         bool isInside(int x, int y);
123         void GetMinMaxPoint(int *minPoint, int *maxPoint);
124         void GetMinMaxPoint(int *minPoint, 
125                                                 int *maxPoint, 
126                                                 manualViewBaseContour *manualviewbaseecontour,
127                                                 manualContourModel *manualcontourmodel );
128         int AnalisisContourInside(      int x, 
129                                                                 int y, 
130                                                                 manualViewBaseContour *manualviewbaseecontour,
131                                                                 manualContourModel *manualcontourmodel );
132         double GetDataValue(int x, int y);
133         void ResetImageResult();
134         void PutVtkImageDataResultValue( int x, int y, double value );
135         void InitVtkImagesResult();
136
137
138   };
139
140
141 #endif  // __ContourCrownWidget_h_INCLUDED_H__
142