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