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 #ifndef EMPTY_PANEL_WIDGET_2_H
27 #define EMPTY_PANEL_WIDGET_2_H
31 #include <vtkImageData.h>
33 #include <vtkMarchingCubes.h>
34 #include <vtkPolyDataMapper.h>
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>
44 //------------------------------------------------------------------
45 //------------------------------------------------------------------
46 //------------------------------------------------------------------
48 class TreeExtraction_MH_JFC : public vtkObject
51 static TreeExtraction_MH_JFC *New();
52 virtual void SetInput(marExperiment *input);
53 void SetBranchLevel(int branchLevel);
54 marExperiment *GetInput();
55 vtkImageData *GetVolume();
57 void SetCleanTreeLevel( int cleanLevel );
60 TreeExtraction_MH_JFC();
61 ~TreeExtraction_MH_JFC();
62 void Execute( int count , int sens=1 , double *vit=NULL , int cleanLevel=0);
67 carotidaBifurcacion *_prgov;
68 vtkImageData *_imagedataResult;
69 marExperiment *_marExperiment;
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 );
77 //------------------------------------------------------------------
78 //------------------------------------------------------------------
79 //------------------------------------------------------------------
81 class wxEmptyPanelWidget_2: public wxPanel{
83 wxEmptyPanelWidget_2(wxWindow *parentmar,marInterface *mar);
84 ~wxEmptyPanelWidget_2();
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);
105 TreeExtraction_MH_JFC *_treeExtraction;
108 vtkMarchingCubes *_mCubes;
109 vtkPolyDataMapper *_surfMapper;
110 vtkActor *_surfActor;
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;
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;
130 // Result tree MH_JFC
131 vtkPolyDataMapper *_isoMapperMC1;
132 vtkActor *_isoActorMC1;
133 vtkMarchingCubes *_isoMC1;
134 vtkImageThreshold *_imageThresholdMC1;
136 std::vector< vtkActor* > _lstBranchActor;
137 std::vector< vtkPolyData* > _lstAxisVtk;
138 std::vector< vtkPolyDataMapper* > _lstBranchMapper;
140 wxSlider *_opacity_OrigVol;
141 wxSlider *_opacity_Res1VolJF;
142 wxSlider *_opacity_Res2VolJF;
143 wxSlider *_sl_sensibility_JF;
145 wxSlider *_branchLevel;
146 wxSlider *_opacity_ResVolMHJF;
147 wxSlider *_isoValue_MH_JFC;
148 wxSlider *_cleanTree_MH_JFC;
150 wxVtk3DBaseView *_imageviewer3D;
151 wxPanel *CreateControlPanel(wxWindow *parent);
152 wxPanel *CreateViewPanel(wxWindow *parent);
156 wxSurfaceWidget *_maracasSurfaceWidget;
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);
163 void ResetTree_MH_JFC();
164 void PaintVascularTree_MH_JFC(marExperiment * newExperiment);
165 void PaintVascularVolume_MH_JFC(vtkImageData * image);
166 void WriteSignals(marExperiment *newExperiment);
169 #endif // EMPTY_PANEL_WIDGET_2_H