]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/include/wxEmptyPanelWidget_2.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / include / wxEmptyPanelWidget_2.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 EMPTY_PANEL_WIDGET_2_H
27 #define EMPTY_PANEL_WIDGET_2_H
28
29 #include <vector>
30
31 #include <vtkImageData.h>
32 #include <vtkActor.h>
33 #include <vtkMarchingCubes.h>
34 #include <vtkPolyDataMapper.h>
35
36 #include "wxVTKRenderWindowInteractor.h"
37 #include "wxSurfaceWidget.h"
38 #include "wxVtkBaseView.h"
39 #include <kernel/marInterface.h>
40 #include <kernel/axisExtractor.h>
41 #include <kernel/axisExtractor02.h>
42 #include <kernel/carotidaBifurcacion.h>
43
44 //------------------------------------------------------------------
45 //------------------------------------------------------------------
46 //------------------------------------------------------------------
47
48 class  TreeExtraction_MH_JFC : public vtkObject
49 {
50 public:
51         static TreeExtraction_MH_JFC *New();
52         virtual void SetInput(marExperiment *input);
53         void SetBranchLevel(int branchLevel);
54         marExperiment *GetInput();
55         vtkImageData  *GetVolume();
56         void Update();
57         void SetCleanTreeLevel( int cleanLevel );
58   
59 protected:  
60         TreeExtraction_MH_JFC();        
61         ~TreeExtraction_MH_JFC();
62         void Execute( int count , int sens=1 , double *vit=NULL , int cleanLevel=0);
63
64 private:
65         double                                  _cleanLevel;
66         int                                             _branchLevel;
67         carotidaBifurcacion             *_prgov;
68         vtkImageData                    *_imagedataResult;
69         marExperiment                   *_marExperiment;
70         void Reset();
71         void InitImagaDataResult();
72         void BruleVolume( vtkImageData *imagedata, int x,int y,int z,int r,int value );
73         void BruleVolume( vtkImageData *imagedata, vtkPolyData *inputAxisRadio,int value );
74         void FindVit( marExperiment *newExperiment , int actualAxis , double *pointBif , double *vit );
75 };
76
77 //------------------------------------------------------------------
78 //------------------------------------------------------------------
79 //------------------------------------------------------------------
80
81 class wxEmptyPanelWidget_2: public wxPanel{
82 public:
83         wxEmptyPanelWidget_2(wxWindow *parentmar,marInterface *mar);
84         ~wxEmptyPanelWidget_2();
85         void ConfigureVTK();
86         void Refresh();
87         void OnOpacity_OrigVol(wxScrollEvent& event);           // Original Volume
88         void OnOpacity_Res1VolJF(wxScrollEvent& event);         // Result 1 Volume JF
89         void OnOpacity_Res2VolJF(wxScrollEvent& event);         // Result 2 Volume JF
90         void OnIsoValue(wxScrollEvent& event);
91         void OnBtnExtractTree1_JF(wxCommandEvent& event);
92         void OnBtnExtractTree2_JF(wxCommandEvent& event);
93         void OnBtnEraseTree1_JF(wxCommandEvent& event);
94         void OnBtnEraseTree2_JF(wxCommandEvent& event);
95         void OnBtnExtractTree_MH_JFC(wxCommandEvent& event);
96         void OnBtnEraseTree_MH_JFC(wxCommandEvent& event);
97         void OnOpacity_ResVolMHJF(wxScrollEvent& event);        // Result Volume MH+JFC
98         void OnBranchLevel(wxScrollEvent& event);                       // MH+JFC
99         void OnIsoValue_MH_JFC(wxScrollEvent& event);
100         void OnCleanTree_MH_JFC(wxScrollEvent& event);
101         void OnSensibility(wxScrollEvent& event);
102
103 private:
104
105         TreeExtraction_MH_JFC *_treeExtraction;
106
107         // Original Volume
108         vtkMarchingCubes        *_mCubes;
109         vtkPolyDataMapper       *_surfMapper;
110         vtkActor                        *_surfActor;
111
112         // Result 1 volume + Axis   
113         axisExtractor           *_1_prgov;
114         vtkPolyDataMapper       *_1_mapfinal;
115         vtkActor                        *_1_stripfinal;
116         vtkPolyDataMapper       *_1_isoMapperMC6;
117         vtkActor                        *_1_isoActorMC6;
118         vtkMarchingCubes        *_1_isoMC6;
119
120         // Result 2 volume + Axis   
121         axisExtractor02         *_2_prgov;
122         vtkPolyDataMapper       *_2_mapfinal;
123         vtkActor                        *_2_stripfinal;
124         vtkPolyDataMapper       *_2_isoMapperMC6;
125         vtkActor                        *_2_isoActorMC6;
126         vtkMarchingCubes        *_2_isoMC6;
127         double                          _sensibility_JF;
128
129
130         //      Result tree MH_JFC
131         vtkPolyDataMapper       *_isoMapperMC1;
132         vtkActor                        *_isoActorMC1;
133         vtkMarchingCubes        *_isoMC1;
134         vtkImageThreshold       *_imageThresholdMC1;
135
136         std::vector< vtkActor* >                        _lstBranchActor;
137         std::vector< vtkPolyData* >                     _lstAxisVtk;
138         std::vector< vtkPolyDataMapper* >       _lstBranchMapper;
139
140         wxSlider                        *_opacity_OrigVol;
141         wxSlider                        *_opacity_Res1VolJF;
142         wxSlider                        *_opacity_Res2VolJF;
143         wxSlider                        *_sl_sensibility_JF;
144         wxSlider                        *_isoValue;
145         wxSlider                        *_branchLevel;
146         wxSlider                        *_opacity_ResVolMHJF;
147         wxSlider                        *_isoValue_MH_JFC;
148         wxSlider                        *_cleanTree_MH_JFC;
149         
150         wxVtk3DBaseView         *_imageviewer3D;
151         wxPanel                         *CreateControlPanel(wxWindow *parent);
152         wxPanel                         *CreateViewPanel(wxWindow *parent);
153
154         //Maracas
155         marInterface            *_mar;
156         wxSurfaceWidget         *_maracasSurfaceWidget;
157
158         void ResetTree1_JF();
159         void ResetTree2_JF();
160         void ExtractTree1_JF(int x, int y, int z);
161         void ExtractTree2_JF(int x, int y, int z);
162
163         void ResetTree_MH_JFC();
164         void PaintVascularTree_MH_JFC(marExperiment * newExperiment);
165         void PaintVascularVolume_MH_JFC(vtkImageData * image);
166         void WriteSignals(marExperiment *newExperiment);
167 };
168
169 #endif // EMPTY_PANEL_WIDGET_2_H
170
171
172
173