6 #include "vtkRenderWindow.h"
7 #include <vtkVolumeRayCastMapper.h>
8 #include "vtkImageActor.h"
10 #include "vtkPolyDataMapper.h"
11 #include "vtkStripper.h"
12 #include <vtkGlyph3D.h>
13 #include "vtkLODActor.h"
14 #include "vtkContourFilter.h"
15 #include "vtkPolyDataNormals.h"
16 #include <vtkClipPolyData.h>
17 #include "vtkOutlineFilter.h"
18 #include <vtkPiecewiseFunction.h>
19 #include <vtkColorTransferFunction.h>
20 #include <vtkVolume.h>
21 #include <vtkVolumeProperty.h>
22 #include <vtkVolumeRayCastMapper.h>
23 #include <vtkVolumeRayCastCompositeFunction.h>
24 #include <vtkBoxWidget.h>
26 #include "wxMPRBaseData.h"
27 #include "wxVtkBaseView.h"
29 //----------------------------------------------------------------------------
32 #define VTKMPRDATA_MAXTISSUE 4
35 //------------------------------------------------------------------
36 //------------------------------------------------------------------
37 //------------------------------------------------------------------
39 // Callback for the interaction
40 class boxVolumeObserver : public vtkCommand{
42 vtkRenderWindow *_renWin;
43 vtkVolumeRayCastMapper *_volumeMapper;
45 boxVolumeObserver() { }
47 virtual char const *GetClassName() const { return "boxVolumeObserver";}
49 static boxVolumeObserver *New(){
50 boxVolumeObserver * result;
51 result = new boxVolumeObserver();
55 virtual void Execute(vtkObject *wdg, unsigned long eventId, void* calldata) ;
56 void SetRenWin( vtkRenderWindow *renWin );
57 void SetVolumeMapper(vtkVolumeRayCastMapper *volumeMapper);
60 //------------------------------------------------------------------
61 //------------------------------------------------------------------
62 //------------------------------------------------------------------
64 // Callback for the interaction
65 class boxSurfaceObserver : public vtkCommand{
70 boxSurfaceObserver() { }
72 virtual char const *GetClassName() const { return "boxSurfaceObserver";}
74 static boxSurfaceObserver *New(){
75 boxSurfaceObserver * result;
76 result = new boxSurfaceObserver();
80 virtual void Execute(vtkObject *wdg, unsigned long eventId, void* calldata) ;
81 void SetPlanes(vtkPlanes *planes);
82 void SetActor(vtkActor *actor);
87 //------------------------------------------------------------------
88 //------------------------------------------------------------------
89 //------------------------------------------------------------------
91 class vtkMPR3DData : public vtkMPRBaseData{
95 vtkImageActor* GetImageActor(int id);
96 vtkActor* GetOutlineActor();
97 vtkPolyDataMapper* GetTissueMapper(int id);
98 vtkPlanes* GetTissuePlanes(int id);
99 vtkStripper* GetTissueStripper(int id);
100 vtkGlyph3D* GetGlyph(int id);
101 vtkLODActor* GetMaceActor(int id);
103 virtual void Configure();
104 void SetIsovalue(int idTissue, int isoValue);
105 wxColour* GetColour(int idColour);
106 void SetVisiblePosition(int idPosition, bool visible);
107 bool GetVisiblePosition(int idPosition);
108 vtkVolume* GetVolumeActor();
109 vtkVolumeRayCastMapper *GetVolumeMapper();
113 bool _visiblePosition[3];
114 wxColour *_colour[ VTKMPRDATA_MAXTISSUE ];
117 vtkContourFilter *_tissueExtractor[ VTKMPRDATA_MAXTISSUE ];
118 vtkPolyDataNormals *_tissueNormals[ VTKMPRDATA_MAXTISSUE ];
119 vtkStripper *_tissueStripper[ VTKMPRDATA_MAXTISSUE ];
120 vtkPolyDataMapper *_tissueMapper[ VTKMPRDATA_MAXTISSUE ];
121 vtkPlanes *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ];
122 vtkClipPolyData *_tissueClipper[ VTKMPRDATA_MAXTISSUE ];
125 vtkOutlineFilter *_outlineData;
126 vtkPolyDataMapper *_mapOutline;
130 vtkPiecewiseFunction *_tfun;
131 vtkColorTransferFunction *_ctfun;
132 vtkVolumeRayCastCompositeFunction *_compositeFunction;
133 vtkVolumeRayCastMapper *_volumeMapper;
134 vtkVolumeProperty *_volumeProperty;
139 //------------------------------------------------------------------
140 //------------------------------------------------------------------
141 //------------------------------------------------------------------
144 class wxVtkMPR3DView: public wxVtk3DBaseView, public vtkMPRBaseView{
146 wxVtkMPR3DView( wxWindow *parent );
148 void SetVtkMPRData(vtkMPR3DData *tmp_vtkmpr3Ddata);
149 vtkActor* GetTissueActor(int id);
150 void VisibleActor(int idTissue, bool visTissue, bool visGuide);
151 void VisibleImageActor(int idPosition, bool visible);
152 void VisibleVolumeActor( bool visVolume,bool visGuide);
153 void SetVisibleTissue(int idTissue, bool visible);
154 bool GetVisibleTissue(int idTissue);
155 virtual void Configure();
158 bool _visibleTissue[VTKMPRDATA_MAXTISSUE];
160 vtkActor *_tissue[VTKMPRDATA_MAXTISSUE];
162 boxVolumeObserver *_observerV;
163 vtkBoxWidget *_boxWidget;
164 boxSurfaceObserver *_observerS1;
165 vtkBoxWidget *_boxWidgetS1;
170 //------------------------------------------------------------------
171 //------------------------------------------------------------------
172 //------------------------------------------------------------------
174 class wxSurfaceMPR: public wxFrame{
177 wxSurfaceMPR(wxWindow *parent, vtkImageData *imagedata, const wxString& title);
179 void OnPositionX(wxScrollEvent& event);
180 void OnPositionY(wxScrollEvent& event);
181 void OnPositionZ(wxScrollEvent& event);
182 void VisibleActor(int idView, int idTissue, bool visTissue, bool visGuide);
183 void VisibleImageActor(int idView, int idTissue, bool visible);
184 void VisibleVolumeActor(int idView, bool visVolume, bool visGuide);
186 void OnVisibleX(wxCommandEvent& event);
187 void OnVisibleY(wxCommandEvent& event);
188 void OnVisibleZ(wxCommandEvent& event);
189 void OnVisibleTissueA(wxCommandEvent& event);
190 void OnVisibleTissueB(wxCommandEvent& event);
191 void OnVisibleTissueC(wxCommandEvent& event);
192 void OnVisibleTissueD(wxCommandEvent& event);
193 void OnVisibleVolume(wxCommandEvent& event);
195 void OpacityTissue(int idView, int idTissue, int opacity);
196 void OnOpacity0(wxScrollEvent& event);
197 void OnOpacity1(wxScrollEvent& event);
198 void OnOpacity2(wxScrollEvent& event);
199 void OnOpacity3(wxScrollEvent& event);
200 void OnIsoValue0(wxScrollEvent& event);
201 void OnIsoValue1(wxScrollEvent& event);
202 void OnIsoValue2(wxScrollEvent& event);
203 void OnIsoValue3(wxScrollEvent& event);
204 void OnIsoValue_0(wxScrollEvent& event);
205 void OnIsoValue_1(wxScrollEvent& event);
206 void OnIsoValue_2(wxScrollEvent& event);
207 void OnIsoValue_3(wxScrollEvent& event);
208 void OnBtnColourA(wxCommandEvent& event);
209 void OnBtnColourB(wxCommandEvent& event);
210 void OnBtnColourC(wxCommandEvent& event);
211 void OnBtnColourD(wxCommandEvent& event);
220 wxCheckBox *_chk1_box1;
221 wxCheckBox *_chk2_box1;
222 wxCheckBox *_chk3_box1;
228 wxSlider *_slA1_box2;
229 wxSlider *_slA2_box2;
230 wxSlider *_slA3_box2;
231 wxSlider *_slB1_box2;
232 wxSlider *_slB2_box2;
233 wxSlider *_slB3_box2;
234 wxSlider *_slC1_box2;
235 wxSlider *_slC2_box2;
236 wxSlider *_slC3_box2;
237 wxSlider *_slD1_box2;
238 wxSlider *_slD2_box2;
239 wxSlider *_slD3_box2;
240 wxCheckBox *_chkA_box2;
241 wxCheckBox *_chkB_box2;
242 wxCheckBox *_chkC_box2;
243 wxCheckBox *_chkD_box2;
244 wxCheckBox *_chkAA_box2;
245 wxCheckBox *_chkBB_box2;
246 wxCheckBox *_chkCC_box2;
247 wxCheckBox *_chkDD_box2;
248 wxCheckBox *_chkViewA_box2;
249 wxCheckBox *_chkViewB_box2;
250 wxCheckBox *_chkViewC_box2;
251 wxCheckBox *_chkViewD_box2;
253 wxStaticText *_text_A;
254 wxStaticText *_text_B;
255 wxStaticText *_text_C;
256 wxStaticText *_text_D;
261 wxCheckBox *_chk_box3;
262 wxCheckBox *_chk_box33;
272 wxCheckBox *_chk_box4;
275 vtkMPR3DData *_vtkmpr3Ddata;
276 wxVtkMPR3DView *_vtkmprview[4];
278 wxPanel* CreateControlPanel(wxWindow *parent);
279 wxPanel* CreateMPRPanel(wxWindow *parent,vtkMPR3DData *vtkmpr3Ddata);
283 #endif // SURFACE_MPR_H