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 #include <vtkPlanes.h>
27 #include <vtkProperty.h>
28 #include <vtkPolyData.h>
29 #include <vtkDataSet.h>
31 #include "wxSurfaceMPR.h"
32 #include <wx/colordlg.h>
36 //-------------------------------------------------------------------
37 //-------------------------------------------------------------------
38 //-------------------------------------------------------------------
43 void boxVolumeObserver::Execute(vtkObject *wdg, unsigned long eventId, void* calldata) { // virtual
44 if (eventId==vtkCommand::StartInteractionEvent){
45 _renWin->SetDesiredUpdateRate(10);
47 if (eventId==vtkCommand::InteractionEvent){
48 _renWin->SetDesiredUpdateRate(0.001);
50 if (eventId==vtkCommand::EndInteractionEvent){
51 vtkPlanes *planes = vtkPlanes::New();
52 vtkBoxWidget *boxwidget = reinterpret_cast<vtkBoxWidget*>(wdg);
53 boxwidget->GetPlanes(planes);
54 _volumeMapper->SetClippingPlanes(planes);
58 //-------------------------------------------------------------------
59 void boxVolumeObserver::SetRenWin( vtkRenderWindow *renWin ){
62 //-------------------------------------------------------------------
63 void boxVolumeObserver::SetVolumeMapper(vtkVolumeRayCastMapper *volumeMapper){
64 _volumeMapper = volumeMapper;
68 //-------------------------------------------------------------------
69 //-------------------------------------------------------------------
70 //-------------------------------------------------------------------
72 void boxSurfaceObserver::Execute(vtkObject *wdg, unsigned long eventId, void* calldata) { // virtual
73 vtkBoxWidget *boxwidget = reinterpret_cast<vtkBoxWidget*>(wdg);
74 boxwidget->GetPlanes(_planes);
75 _actor->VisibilityOn();
77 //-------------------------------------------------------------------
78 void boxSurfaceObserver::SetPlanes(vtkPlanes *planes){
81 //-------------------------------------------------------------------
82 void boxSurfaceObserver::SetActor(vtkActor *actor){
88 //-------------------------------------------------------------------
89 //-------------------------------------------------------------------
90 //-------------------------------------------------------------------
94 vtkMPR3DData::vtkMPR3DData()
96 _colour[0]= new wxColour(255,127, 64);
97 _colour[1]= new wxColour(255,255,250);
98 _colour[2]= new wxColour( 0,255,000);
99 _colour[3]= new wxColour( 0, 0,255);
100 _visiblePosition[0]=true;
101 _visiblePosition[1]=true;
102 _visiblePosition[2]=true;
104 //-------------------------------------------------------------------
105 vtkMPR3DData::~vtkMPR3DData()
108 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
109 _tissueExtractor[i] ->Delete();
110 _tissueNormals[i] ->Delete();
111 _tissueStripper[i] ->Delete();
112 _tissueMapper[i] ->Delete();
114 _tissuePlanes[i] ->Delete();
115 _tissueClipper[i] ->Delete();
117 _outlineData ->Delete();
118 _mapOutline ->Delete();
124 _compositeFunction ->Delete();
125 _volumeMapper ->Delete();
126 _volumeProperty ->Delete();
129 //-------------------------------------------------------------------
130 vtkActor* vtkMPR3DData::GetOutlineActor()
134 //-------------------------------------------------------------------
135 vtkPolyDataMapper* vtkMPR3DData::GetTissueMapper(int id)
137 return _tissueMapper[id];
139 //-------------------------------------------------------------------
140 vtkPlanes* vtkMPR3DData::GetTissuePlanes(int id)
142 return _tissuePlanes[id];
144 //-------------------------------------------------------------------
145 vtkStripper* vtkMPR3DData::GetTissueStripper(int id)
147 return _tissueStripper[id];
149 //-------------------------------------------------------------------
150 vtkImageActor* vtkMPR3DData::GetImageActor(int id)
152 vtkImageActor *tmpVtkActor=NULL;
154 tmpVtkActor = GetvtkActor_saggital();
157 tmpVtkActor = GetvtkActor_coronal();
160 tmpVtkActor = GetvtkActor_axial();
164 //-------------------------------------------------------------------
165 void vtkMPR3DData::Configure()
169 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
171 _tissueExtractor[i] = vtkContourFilter::New();
172 _tissueExtractor[i]->SetInput((vtkDataSet *) GetImageData() );
173 _tissueExtractor[i]->SetValue(0, 0);
174 _tissueNormals[i] = vtkPolyDataNormals::New();
175 _tissueNormals[i]->SetInput(_tissueExtractor[i]->GetOutput());
176 _tissueNormals[i]->SetFeatureAngle(60.0);
177 _tissueStripper[i] = vtkStripper::New();
178 _tissueStripper[i]->SetInput(_tissueNormals[i]->GetOutput());
181 _tissuePlanes[i] = vtkPlanes::New();
182 _tissueClipper[i] = vtkClipPolyData::New();
183 _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
184 _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
185 _tissueClipper[i]->InsideOutOn( );
187 _tissueMapper[i] = vtkPolyDataMapper::New();
188 _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
190 _tissueMapper[i] = vtkPolyDataMapper::New();
191 _tissueMapper[i]->SetInput(_tissueStripper[i]->GetOutput());
192 // _tissueMapper[i]->ScalarVisibilityOff();
200 // An outline provides context around the data.
202 _outlineData = vtkOutlineFilter::New();
203 _outlineData->SetInput((vtkDataSet *) GetImageData() );
204 _mapOutline = vtkPolyDataMapper::New();
205 _mapOutline->SetInput(_outlineData->GetOutput());
206 _outline = vtkActor::New();
207 _outline->SetMapper(_mapOutline);
208 _outline->GetProperty()->SetColor(0,0,0);
210 // Now we are creating three orthogonal planes passing through the
211 // volume. Each plane uses a different texture map and therefore has
212 // diferent coloration.
216 _tfun = vtkPiecewiseFunction::New();
218 // _tfun->AddPoint(70.0, 0.0);
219 // _tfun->AddPoint(599.0, 0);
220 // _tfun->AddPoint(600.0, 0);
221 // _tfun->AddPoint(1195.0, 0);
222 // _tfun->AddPoint(1200, .2);
223 // _tfun->AddPoint(1300, .3);
224 // _tfun->AddPoint(2000, .3);
225 // _tfun->AddPoint(4095.0, 1.0);
227 _tfun->AddPoint(70 , 0.0);
228 _tfun->AddPoint(599 , 0.0);
229 _tfun->AddPoint(600 , 0.0);
230 _tfun->AddPoint(1110, 0.0);
231 _tfun->AddPoint(1111, 1.0);
232 _tfun->AddPoint(1300, 1.0);
233 _tfun->AddPoint(2000, 1.0);
234 _tfun->AddPoint(4095, 1.0);
236 _ctfun = vtkColorTransferFunction::New();
238 // _ctfun->AddRGBPoint(0.0, 0.5, 0.0, 0.0);
239 // _ctfun->AddRGBPoint(600.0, 1.0, 0.5, 0.5);
240 // _ctfun->AddRGBPoint(1280.0, 0.9, 0.2, 0.3);
241 // _ctfun->AddRGBPoint(1960.0, 0.81, 0.27, 0.1);
242 // _ctfun->AddRGBPoint(4095.0, 0.5, 0.5, 0.5);
244 _ctfun->AddRGBPoint(0.0 , 0.5 , 0.0 , 0.0 );
245 _ctfun->AddRGBPoint(600.0 , 1.0 , 0.5 , 0.5 );
246 _ctfun->AddRGBPoint(1130.0 , 0.9 , 0.2 , 0.3 );
247 _ctfun->AddRGBPoint(1131.0 , 0.3 , 0.9 , 0.9 );
248 _ctfun->AddRGBPoint(1135.0 , 0.3 , 0.8 , 0.8 );
249 _ctfun->AddRGBPoint(1960.0 , 0.1 , 0.27 , 0.71);
250 _ctfun->AddRGBPoint(4095.0 , 0.5 , 0.5 , 0.5 );
252 _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
254 _volumeMapper = vtkVolumeRayCastMapper::New();
255 _volumeMapper->SetInput( GetImageData() );
256 _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
258 _volumeProperty = vtkVolumeProperty::New();
259 _volumeProperty->SetColor(_ctfun);
260 _volumeProperty->SetScalarOpacity(_tfun);
261 _volumeProperty->SetInterpolationTypeToLinear();
262 _volumeProperty->ShadeOn();
264 _newvol = vtkVolume::New();
265 _newvol->SetMapper(_volumeMapper);
266 _newvol->SetProperty(_volumeProperty);
268 vtkMPRBaseData::Configure();
273 //-------------------------------------------------------------------
274 void vtkMPR3DData::SetIsovalue(int idTissue, int isoValue)
276 _tissueExtractor[idTissue]->SetValue(0, isoValue);
279 //-------------------------------------------------------------------
280 wxColour* vtkMPR3DData::GetColour(int idColour)
282 return _colour[idColour];
284 //-------------------------------------------------------------------
285 void vtkMPR3DData::SetVisiblePosition(int idPosition, bool visible)
287 _visiblePosition[idPosition]=visible;
289 //-------------------------------------------------------------------
290 bool vtkMPR3DData::GetVisiblePosition(int idPosition)
292 return _visiblePosition[idPosition];
294 //-------------------------------------------------------------------
295 vtkVolume* vtkMPR3DData::GetVolumeActor()
299 //-------------------------------------------------------------------
300 vtkVolumeRayCastMapper* vtkMPR3DData::GetVolumeMapper(){
301 return _volumeMapper;
306 //-------------------------------------------------------------------
307 //-------------------------------------------------------------------
308 //-------------------------------------------------------------------
312 wxVtkMPR3DView::wxVtkMPR3DView(wxWindow *parent)
313 :wxVtk3DBaseView( parent )
316 for (i=0; i<VTKMPRDATA_MAXTISSUE; i++){
317 _visibleTissue[i]=true;
323 //-------------------------------------------------------------------
324 wxVtkMPR3DView::~wxVtkMPR3DView(){
326 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
327 _tissue[i]->Delete();
330 _boxWidget -> Delete();
331 _observerV -> Delete();
332 _boxWidgetS1 -> Delete();
333 _observerS1 -> Delete();
336 //-------------------------------------------------------------------
337 void wxVtkMPR3DView::SetVisibleTissue(int idTissue, bool visible){
338 _visibleTissue[idTissue]=visible;
340 //-------------------------------------------------------------------
341 bool wxVtkMPR3DView::GetVisibleTissue(int idTissue){
342 return _visibleTissue[idTissue];
344 //-------------------------------------------------------------------
345 vtkActor* wxVtkMPR3DView::GetTissueActor(int id){
348 //-------------------------------------------------------------------
349 void wxVtkMPR3DView::Configure(){
350 vtkMPR3DData *vtkmpr3Ddata = (vtkMPR3DData*)GetVtkmprbasedata();
351 wxVtk3DBaseView::Configure();
354 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
356 _tissue[i] = vtkActor::New();
357 _tissue[i]->SetMapper(vtkmpr3Ddata->GetTissueMapper(i));
359 // wxColour* cc=_vtkmprdata->GetColour(i);
360 // float cr=cc->Red(),cg=cc->Green(),cb=cc->Blue();
361 // _tissue[i]->GetProperty()->SetDiffuseColor(cr/255, cg/255 , cb/255 );
362 // _tissue[i]->GetProperty()->SetSpecular(.3);
363 // _tissue[i]->GetProperty()->SetSpecularPower(20);
365 if (i==0) _tissue[i]->GetProperty()->SetColor(1, 0 , 0 );
366 if (i==2) _tissue[i]->GetProperty()->SetColor(0.85, 0.85 , 0.85 );
367 if (i==3) _tissue[i]->GetProperty()->SetColor(0, 1 , 0 );
368 if (i==4) _tissue[i]->GetProperty()->SetColor(0, 0 , 1 );
371 _tissue[i]->VisibilityOff();
372 _tissue[i]->SetScale(1.01, 1.01, 1.01);
377 GetRenderer()->AddVolume( vtkmpr3Ddata->GetVolumeActor() ); // RayCast
378 GetRenderer()->SetBackground(0.5, 0.5, 0.5);
380 // Actors are added to the renderer.
381 GetRenderer()->AddActor( vtkmpr3Ddata->GetOutlineActor() );
382 GetRenderer()->AddActor( vtkmpr3Ddata->GetImageActor(0) ); // _saggital
383 GetRenderer()->AddActor( vtkmpr3Ddata->GetImageActor(1) ); // _axial
384 GetRenderer()->AddActor( vtkmpr3Ddata->GetImageActor(2) ); // _coronal
390 // The SetInteractor method is how 3D widgets are associated with the
391 // render window interactor. Internally, SetInteractor sets up a bunch
392 // of callbacks using the Command/Observer mechanism (AddObserver()).
393 _boxWidget = vtkBoxWidget::New();
394 _boxWidget->SetInteractor( GetWxVTKRenderWindowInteractor() );
395 _boxWidget->SetPlaceFactor(1.0);
397 // Place the interactor initially. The output of the reader is used to
398 // place the box widget.
400 _observerV = boxVolumeObserver::New();
401 _observerV->SetRenWin( GetRenWin() );
402 _observerV->SetVolumeMapper( vtkmpr3Ddata->GetVolumeMapper() );
404 _boxWidget->SetInput( vtkmpr3Ddata->GetImageData() );
405 _boxWidget->PlaceWidget();
406 _boxWidget->InsideOutOn();
407 _boxWidget->AddObserver( vtkCommand::StartInteractionEvent , _observerV );
408 _boxWidget->AddObserver( vtkCommand::InteractionEvent , _observerV );
409 _boxWidget->AddObserver( vtkCommand::EndInteractionEvent , _observerV );
412 vtkProperty *outlineProperty = _boxWidget->GetOutlineProperty();
413 outlineProperty->SetRepresentationToWireframe();
414 outlineProperty->SetAmbient(1.0);
415 outlineProperty->SetAmbientColor(1, 1, 1);
416 outlineProperty->SetLineWidth(3);
418 vtkProperty *selectedOutlineProperty = _boxWidget->GetSelectedOutlineProperty();
419 selectedOutlineProperty->SetRepresentationToWireframe();
420 selectedOutlineProperty->SetAmbient(1.0);
421 selectedOutlineProperty->SetAmbientColor(1, 0, 0);
422 selectedOutlineProperty->SetLineWidth(3);
427 // Place the interactor initially. The output of the reader is used to
428 // place the box widget.
430 // _observerV = boxVolumeObserver::New();
431 // _observerV->SetRenWin( _renWin );
432 // _observerV->SetVolumeMapper( _vtkmprdata->GetVolumeMapper() );
434 _observerS1 = boxSurfaceObserver::New();
435 _observerS1->SetPlanes( vtkmpr3Ddata->GetTissuePlanes(0) );
436 _observerS1->SetActor( _tissue[0] );
438 _boxWidgetS1 = vtkBoxWidget::New();
439 _boxWidgetS1->SetInteractor( GetWxVTKRenderWindowInteractor() );
440 _boxWidgetS1->SetPlaceFactor(1.25);
443 _boxWidgetS1->SetInput( vtkmpr3Ddata->GetTissueStripper(0)->GetOutput() );
444 // _boxWidgetS1->SetInput( vtkmpr3Ddata->GetGlyph(0)->GetOutput() );
445 _boxWidgetS1->PlaceWidget();
446 _boxWidgetS1->InsideOutOff();
447 // _boxWidgetS1->AddObserver( vtkCommand::StartInteractionEvent , _observerV );
448 // _boxWidgetS1->AddObserver( vtkCommand::InteractionEvent , _observerV );
449 // _boxWidgetS1->AddObserver( vtkCommand::EndInteractionEvent , _observerV );
450 // _boxWidgetS1->AddObserver( vtkCommand::EndInteractionEvent , _observerS1 );
451 _boxWidgetS1->AddObserver( vtkCommand::InteractionEvent , _observerS1 );
453 // vtkProperty *outlinePropertyS1 = _boxWidgetS1->GetOutlineProperty();
454 // outlinePropertyS1->SetRepresentationToWireframe();
455 // outlinePropertyS1->SetAmbient(1.0);
456 // outlinePropertyS1->SetAmbientColor(0, 0, 1);
457 // outlinePropertyS1->SetLineWidth(3);
459 // vtkProperty *selectedOutlinePropertyS1 = _boxWidgetS1->GetSelectedOutlineProperty();
460 // selectedOutlinePropertyS1->SetRepresentationToWireframe();
461 // selectedOutlinePropertyS1->SetAmbient(1.0);
462 // selectedOutlinePropertyS1->SetAmbientColor(1, 0, 0);
463 // selectedOutlinePropertyS1->SetLineWidth(3);
467 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
468 GetRenderer()->AddActor( _tissue[i] );
475 // Turn off bone for this example.
476 // _bone->VisibilityOff();
479 // An initial camera view is created. The Dolly() method moves
480 // the camera towards the FocalPoint, thereby enlarging the image.
481 GetRenderer()->SetActiveCamera(GetCamera());
482 GetRenderer()->ResetCamera ();
483 GetCamera()->Dolly(1.5);
485 // Set a background color for the renderer and set the size of the
486 // render window (expressed in pixels).
487 GetRenderer()->SetBackground(1,1,1);
488 GetRenWin()->SetSize(400, 400);
490 // Note that when camera movement occurs (as it does in the Dolly()
491 // method), the clipping planes often need adjusting. Clipping planes
492 // consist of two planes: near and far along the view direction. The
493 // near plane clips out objects in front of the plane; the far plane
494 // clips out objects behind the plane. This way only what is drawn
495 // between the planes is actually rendered.
496 GetRenderer()->ResetCameraClippingRange();
501 //-------------------------------------------------------------------
502 void wxVtkMPR3DView::VisibleActor(int idTissue, bool visTissue, bool visGuide){
503 if (visTissue!=GetVisibleTissue(idTissue)){
504 if (visTissue==false){
505 GetRenderer()->RemoveActor( GetTissueActor(idTissue) );
507 GetRenderer()->AddActor( GetTissueActor(idTissue) );
509 SetVisibleTissue(idTissue,visTissue);
519 //-------------------------------------------------------------------
520 void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible){
521 vtkMPR3DData *vtkmpr3Ddata = (vtkMPR3DData*)GetVtkmprbasedata();
522 if (visible!=vtkmpr3Ddata->GetVisiblePosition(idPosition)){
524 GetRenderer()->RemoveActor( vtkmpr3Ddata->GetImageActor(idPosition) );
526 GetRenderer()->AddActor( vtkmpr3Ddata->GetImageActor(idPosition) );
528 vtkmpr3Ddata->SetVisiblePosition(idPosition,visible);
532 //-------------------------------------------------------------------
534 void wxVtkMPR3DView::VisibleVolumeActor( bool visVolume,bool visGuide){
535 vtkMPR3DData *vtkmpr3Ddata = (vtkMPR3DData*)GetVtkmprbasedata();
536 if (visVolume!=_visibleVolume){
537 if (visVolume==false){
538 GetRenderer()->RemoveActor( vtkmpr3Ddata->GetVolumeActor() );
540 GetRenderer()->AddActor( vtkmpr3Ddata->GetVolumeActor() );
542 _visibleVolume=visVolume;
553 //-------------------------------------------------------------------
554 //-------------------------------------------------------------------
555 //-------------------------------------------------------------------
559 wxSurfaceMPR::wxSurfaceMPR(wxWindow *parent, vtkImageData *imagedata, const wxString& title)
560 : wxFrame( parent, -1, title) {
562 _vtkmpr3Ddata = new vtkMPR3DData();
563 _vtkmpr3Ddata->SetImageData(imagedata);
565 wxPanel *MPRPanel = CreateMPRPanel(this,_vtkmpr3Ddata);
566 wxPanel *controlPanel = CreateControlPanel(this);
568 wxFlexGridSizer *sizer = new wxFlexGridSizer(2);
569 sizer->Add(MPRPanel );
570 sizer->Add(controlPanel );
571 this->SetSizer(sizer);
572 this->SetAutoLayout(true);
573 this->SetSize(800,900);
576 //-------------------------------------------------------------------
577 wxPanel* wxSurfaceMPR::CreateMPRPanel(wxWindow *parent, vtkMPR3DData *vtkmpr3Ddata){
578 wxPanel *panel=new wxPanel(parent,-1);
580 _vtkmprview[1] = new wxVtkMPR3DView(panel);
581 _vtkmprview[1]->SetVtkmprbasedata(vtkmpr3Ddata);
582 wxVTKRenderWindowInteractor *iren1 = _vtkmprview[1]->GetWxVTKRenderWindowInteractor();
584 _vtkmprview[2] = new wxVtkMPR3DView(panel);
585 _vtkmprview[2]->SetVtkmprbasedata(vtkmpr3Ddata);
586 wxVTKRenderWindowInteractor *iren2 = _vtkmprview[2]->GetWxVTKRenderWindowInteractor();
588 _vtkmprview[3] = new wxVtkMPR3DView(panel);
589 _vtkmprview[3]->SetVtkmprbasedata(vtkmpr3Ddata);
590 wxVTKRenderWindowInteractor *iren3 = _vtkmprview[3]->GetWxVTKRenderWindowInteractor();
592 _vtkmprview[0] = new wxVtkMPR3DView(panel);
593 _vtkmprview[0]->SetVtkmprbasedata(vtkmpr3Ddata);
594 wxVTKRenderWindowInteractor *iren0 = _vtkmprview[0]->GetWxVTKRenderWindowInteractor();
596 wxBoxSizer *sizerV = new wxBoxSizer(wxVERTICAL);
597 wxBoxSizer *sizerH1= new wxBoxSizer(wxHORIZONTAL);
598 wxBoxSizer *sizerH2= new wxBoxSizer(wxHORIZONTAL);
599 sizerH1->Add(iren0 , 1, wxEXPAND, 0);
601 sizerH1->Add(iren1 , 1, wxEXPAND, 0);
602 sizerH2->Add(iren2 , 1, wxEXPAND, 0);
603 sizerH2->Add(iren3 , 1, wxEXPAND, 0);
605 sizerV->Add(sizerH1, 1, wxEXPAND, 0);
606 sizerV->Add(sizerH2, 1, wxEXPAND, 0);
608 panel->SetAutoLayout(true);
609 panel->SetSizer(sizerV);
610 panel->SetSize(900,900);
617 //-------------------------------------------------------------------
619 wxPanel* wxSurfaceMPR::CreateControlPanel(wxWindow *parent){
620 wxPanel *panel=new wxPanel(parent,-1);
623 wxPanel *panel1 =new wxPanel(panel,-1);
624 wxStaticText *text_space1 = new wxStaticText(panel1,-1," ");
625 wxStaticText *text1_box1 = new wxStaticText(panel1,-1,"x ");
626 wxStaticText *text2_box1 = new wxStaticText(panel1,-1,"y ");
627 wxStaticText *text3_box1 = new wxStaticText(panel1,-1,"z ");
628 _sl1_box1 = new wxSlider( panel1, -1, 0, 0, _vtkmpr3Ddata->GetMaxPositionX(), wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
629 _sl2_box1 = new wxSlider( panel1, -1, 0, 0, _vtkmpr3Ddata->GetMaxPositionY(), wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
630 _sl3_box1 = new wxSlider( panel1, -1, 0, 0, _vtkmpr3Ddata->GetMaxPositionZ(), wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
632 _sl1_box1->SetSize(250,20);
633 _sl2_box1->SetSize(250,20);
634 _sl3_box1->SetSize(250,20);
636 wxFlexGridSizer *sizerBox1 = new wxFlexGridSizer(3);
638 sizerBox1->Add(text_space1);
639 sizerBox1->Add(text1_box1);
640 sizerBox1->Add( _sl1_box1);
642 sizerBox1->Add(text_space1);
643 sizerBox1->Add(text2_box1);
644 sizerBox1->Add( _sl2_box1);
646 sizerBox1->Add(text_space1);
647 sizerBox1->Add(text3_box1);
648 sizerBox1->Add( _sl3_box1);
649 panel1->SetSizer(sizerBox1);
650 panel1->SetAutoLayout(true);
651 panel1->SetSize(250,80);
655 wxPanel *panel2 =new wxPanel(panel,-1);
656 wxStaticText *text_space2 = new wxStaticText(panel2,-1," ");
657 wxStaticText *text_ = new wxStaticText(panel2,-1," ");
658 _btnA = new wxButton(panel2,-1,"A");
659 _btnB = new wxButton(panel2,-1,"B");
660 _btnC = new wxButton(panel2,-1,"C");
661 _btnD = new wxButton(panel2,-1,"D");
662 _text_A = new wxStaticText(panel2,-1,"000000");
663 _text_B = new wxStaticText(panel2,-1,"000000");
664 _text_C = new wxStaticText(panel2,-1,"000000");
665 _text_D = new wxStaticText(panel2,-1,"000000");
666 wxStaticText *text_A = new wxStaticText(panel2,-1,"A ");
667 wxStaticText *text_B = new wxStaticText(panel2,-1,"B ");
668 wxStaticText *text_C = new wxStaticText(panel2,-1,"C ");
669 wxStaticText *text_D = new wxStaticText(panel2,-1,"D ");
670 _slA1_box2 = new wxSlider( panel2, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
671 _slA2_box2 = new wxSlider( panel2, -1, 0, 0, 60, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
672 _slA3_box2 = new wxSlider( panel2, -1, 0, 0, 50, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
673 _slB1_box2 = new wxSlider( panel2, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
674 _slB2_box2 = new wxSlider( panel2, -1, 0, 0, 60, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
675 _slB3_box2 = new wxSlider( panel2, -1, 0, 0, 50, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
676 _slC1_box2 = new wxSlider( panel2, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
677 _slC2_box2 = new wxSlider( panel2, -1, 0, 0, 60, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
678 _slC3_box2 = new wxSlider( panel2, -1, 0, 0, 50, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
679 _slD1_box2 = new wxSlider( panel2, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
680 _slD2_box2 = new wxSlider( panel2, -1, 0, 0, 60, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
681 _slD3_box2 = new wxSlider( panel2, -1, 0, 0, 50, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
683 _chk1_box1 = new wxCheckBox(panel2, -1, "Visible X");
684 _chk2_box1 = new wxCheckBox(panel2, -1, "Visible Y");
685 _chk3_box1 = new wxCheckBox(panel2, -1, "Visible Z");
687 _chkA_box2 = new wxCheckBox(panel2, -1, "Vis.");
688 _chkB_box2 = new wxCheckBox(panel2, -1, "Vis.");
689 _chkC_box2 = new wxCheckBox(panel2, -1, "Vis.");
690 _chkD_box2 = new wxCheckBox(panel2, -1, "Vis.");
691 _chkAA_box2 = new wxCheckBox(panel2, -1, ".");
692 _chkBB_box2 = new wxCheckBox(panel2, -1, ".");
693 _chkCC_box2 = new wxCheckBox(panel2, -1, ".");
694 _chkDD_box2 = new wxCheckBox(panel2, -1, ".");
695 _chkViewA_box2 = new wxCheckBox(panel2, -1, "A");
696 _chkViewB_box2 = new wxCheckBox(panel2, -1, "B");
697 _chkViewC_box2 = new wxCheckBox(panel2, -1, "C");
698 _chkViewD_box2 = new wxCheckBox(panel2, -1, "D");
700 _chk1_box1->SetValue(true);
701 _chk2_box1->SetValue(true);
702 _chk3_box1->SetValue(true);
703 _chkA_box2->SetValue(true);
704 _chkB_box2->SetValue(true);
705 _chkC_box2->SetValue(true);
706 _chkD_box2->SetValue(true);
707 _chkAA_box2->SetValue(true);
708 _chkBB_box2->SetValue(true);
709 _chkCC_box2->SetValue(true);
710 _chkDD_box2->SetValue(true);
711 _chkViewA_box2->SetValue(true);
712 _chkViewB_box2->SetValue(true);
713 _chkViewC_box2->SetValue(true);
714 _chkViewD_box2->SetValue(true);
716 _slA1_box2->SetSize(250,20);
717 _slA2_box2->SetSize(150,20);
718 _slA3_box2->SetSize(150,20);
719 _slB1_box2->SetSize(250,20);
720 _slB2_box2->SetSize(150,20);
721 _slB3_box2->SetSize(150,20);
722 _slC1_box2->SetSize(250,20);
723 _slC2_box2->SetSize(150,20);
724 _slC3_box2->SetSize(150,20);
725 _slD1_box2->SetSize(250,20);
726 _slD2_box2->SetSize(150,20);
727 _slD3_box2->SetSize(150,20);
728 _btnA->SetSize(20,20);
729 _btnB->SetSize(20,20);
730 _btnC->SetSize(20,20);
731 _btnD->SetSize(20,20);
733 _btnA->SetBackgroundColour( *(_vtkmpr3Ddata->GetColour(0)) );
734 _btnB->SetBackgroundColour( *(_vtkmpr3Ddata->GetColour(1)) );
735 _btnC->SetBackgroundColour( *(_vtkmpr3Ddata->GetColour(2)) );
736 _btnD->SetBackgroundColour( *(_vtkmpr3Ddata->GetColour(3)) );
739 wxFlexGridSizer *sizerPanel2A = new wxFlexGridSizer(5);
741 sizerPanel2A->Add(text_space2);
742 sizerPanel2A->Add(text_A);
743 sizerPanel2A->Add(_slA2_box2);
744 sizerPanel2A->Add(_slA3_box2);
745 sizerPanel2A->Add(_text_A);
747 sizerPanel2A->Add(text_space2);
748 sizerPanel2A->Add(text_B);
749 sizerPanel2A->Add(_slB2_box2);
750 sizerPanel2A->Add(_slB3_box2);
751 sizerPanel2A->Add(_text_B);
753 sizerPanel2A->Add(text_space2);
754 sizerPanel2A->Add(text_C);
755 sizerPanel2A->Add(_slC2_box2);
756 sizerPanel2A->Add(_slC3_box2);
757 sizerPanel2A->Add(_text_C);
759 sizerPanel2A->Add(text_space2);
760 sizerPanel2A->Add(text_D);
761 sizerPanel2A->Add(_slD2_box2);
762 sizerPanel2A->Add(_slD3_box2);
763 sizerPanel2A->Add(_text_D);
766 wxFlexGridSizer *sizerPanel2B = new wxFlexGridSizer(5);
768 sizerPanel2B->Add(text_space2);
769 sizerPanel2B->Add(_btnA);
770 sizerPanel2B->Add(_slA1_box2);
771 sizerPanel2B->Add(_chkA_box2);
772 sizerPanel2B->Add(_chkAA_box2);
774 sizerPanel2B->Add(text_space2);
775 sizerPanel2B->Add(_btnB);
776 sizerPanel2B->Add(_slB1_box2);
777 sizerPanel2B->Add(_chkB_box2);
778 sizerPanel2B->Add(_chkBB_box2);
780 sizerPanel2B->Add(text_space2);
781 sizerPanel2B->Add(_btnC);
782 sizerPanel2B->Add(_slC1_box2);
783 sizerPanel2B->Add(_chkC_box2);
784 sizerPanel2B->Add(_chkCC_box2);
786 sizerPanel2B->Add(text_space2);
787 sizerPanel2B->Add(_btnD);
788 sizerPanel2B->Add(_slD1_box2);
789 sizerPanel2B->Add(_chkD_box2);
790 sizerPanel2B->Add(_chkDD_box2);
792 wxFlexGridSizer *sizerPanel2C = new wxFlexGridSizer(4);
793 sizerPanel2C->Add(_chkViewA_box2);
794 sizerPanel2C->Add(_chkViewB_box2);
795 sizerPanel2C->Add(_chkViewC_box2);
796 sizerPanel2C->Add(_chkViewD_box2);
798 wxFlexGridSizer *sizerPanel2D = new wxFlexGridSizer(2);
799 sizerPanel2D->Add(text_space2);
800 sizerPanel2D->Add(_chk1_box1);
801 sizerPanel2D->Add(text_space2);
802 sizerPanel2D->Add(_chk2_box1);
803 sizerPanel2D->Add(text_space2);
804 sizerPanel2D->Add(_chk3_box1);
806 wxFlexGridSizer *sizerPanel2 = new wxFlexGridSizer(1);
807 sizerPanel2->Add(sizerPanel2A);
808 sizerPanel2->Add(text_space2);
809 sizerPanel2->Add(sizerPanel2C);
810 sizerPanel2->Add(text_space2);
811 sizerPanel2->Add(sizerPanel2D);
812 sizerPanel2->Add(text_space2);
813 sizerPanel2->Add(sizerPanel2B);
815 panel2->SetSizer(sizerPanel2);
816 panel2->SetAutoLayout(true);
817 panel2->SetSize(350,320);
820 wxPanel *panel3 = new wxPanel(panel,-1);
821 wxStaticText *text_space3 = new wxStaticText(panel3,-1," ");
822 _chk_box3 = new wxCheckBox(panel3, -1, "Vis.");
823 _chk_box33 = new wxCheckBox(panel3, -1, "Vis.");
824 _chk_box3->SetValue(true);
825 _chk_box33->SetValue(true);
826 wxFlexGridSizer *sizerPanel3 = new wxFlexGridSizer(3);
828 sizerPanel3->Add(text_space3);
829 sizerPanel3->Add(_chk_box3);
830 sizerPanel3->Add(_chk_box33);
831 panel3->SetSizer(sizerPanel3);
832 panel3->SetAutoLayout(true);
833 panel3->SetSize(250,100);
835 // _sl1_box3 = new wxSlider( panel3, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
836 // _sl2_box3 = new wxSlider( panel3, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
837 // _sl3_box3 = new wxSlider( panel3, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
838 // wxStaticText *text1_box3 = new wxStaticText(panel3,-1,"A");
839 // wxStaticText *text2_box3 = new wxStaticText(panel3,-1,"B");
840 // wxStaticText *text3_box3 = new wxStaticText(panel3,-1,"Dist");
841 // wxFlexGridSizer *sizerPanel3 = new wxFlexGridSizer(3);
843 // sizerPanel3->Add(text_space3);
844 // sizerPanel3->Add(_chk_box3);
845 // sizerPanel3->Add(text_space3);
847 // sizerPanel3->Add(text_space3);
848 // sizerPanel3->Add(text1_box3);
849 // sizerPanel3->Add(_sl1_box3);
851 // sizerPanel3->Add(text_space3);
852 // sizerPanel3->Add(text2_box3);
853 // sizerPanel3->Add(_sl2_box3);
855 // sizerPanel3->Add(text_space3);
856 // sizerPanel3->Add(text3_box3);
857 // sizerPanel3->Add(_sl3_box3);
858 // panel3->SetSizer(sizerPanel3);
859 // panel3->SetAutoLayout(true);
860 // panel3->SetSize(250,100);
863 // wxPanel *panel4 = new wxPanel(panel,-1);
864 // _chk_box4 = new wxCheckBox(panel4, -1, "Vis.");
865 // _slA_box4 = new wxSlider( panel4, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
866 // _slB_box4 = new wxSlider( panel4, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
867 // _sl1_box4 = new wxSlider( panel4, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
868 // _sl2_box4 = new wxSlider( panel4, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
869 // _sl3_box4 = new wxSlider( panel4, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
870 // _sl4_box4 = new wxSlider( panel4, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
871 // _sl5_box4 = new wxSlider( panel4, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
872 // _sl6_box4 = new wxSlider( panel4, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
873 // wxStaticText *text_space4 = new wxStaticText(panel3,-1," ");
874 // wxStaticText *textA_box4 = new wxStaticText(panel4,-1,"A");
875 // wxStaticText *textB_box4 = new wxStaticText(panel4,-1,"B");
876 // wxStaticText *text1_box4 = new wxStaticText(panel4,-1,"D1");
877 // wxStaticText *text2_box4 = new wxStaticText(panel4,-1,"D2");
878 // wxStaticText *text3_box4 = new wxStaticText(panel4,-1,"D3");
879 // wxStaticText *text4_box4 = new wxStaticText(panel4,-1,"D4");
880 // wxStaticText *text5_box4 = new wxStaticText(panel4,-1,"D5");
881 // wxStaticText *text6_box4 = new wxStaticText(panel4,-1,"D6");
882 // wxFlexGridSizer *sizerPanel4 = new wxFlexGridSizer(3);
884 // sizerPanel4->Add(text_space4);
885 // sizerPanel4->Add(_chk_box4);
886 // sizerPanel4->Add(text_space4);
888 // sizerPanel4->Add(text_space4);
889 // sizerPanel4->Add(textA_box4);
890 // sizerPanel4->Add(_slA_box4);
892 // sizerPanel4->Add(text_space4);
893 // sizerPanel4->Add(textB_box4);
894 // sizerPanel4->Add(_slB_box4);
896 // sizerPanel4->Add(text_space4);
897 // sizerPanel4->Add(text1_box4);
898 // sizerPanel4->Add(_sl1_box4);
900 // sizerPanel4->Add(text_space4);
901 // sizerPanel4->Add(text2_box4);
902 // sizerPanel4->Add(_sl2_box4);
904 // sizerPanel4->Add(text_space4);
905 // sizerPanel4->Add(text3_box4);
906 // sizerPanel4->Add(_sl3_box4);
908 // sizerPanel4->Add(text_space4);
909 // sizerPanel4->Add(text4_box4);
910 // sizerPanel4->Add(_sl4_box4);
912 // sizerPanel4->Add(text_space4);
913 // sizerPanel4->Add(text5_box4);
914 // sizerPanel4->Add(_sl5_box4);
916 // sizerPanel4->Add(text_space4);
917 // sizerPanel4->Add(text6_box4);
918 // sizerPanel4->Add(_sl6_box4);
920 // panel4->SetSizer(sizerPanel4);
921 // panel4->SetAutoLayout(true);
922 // panel4->SetSize(250,300);
927 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
929 sizer->Add(new wxStaticText(panel,-1,"Position") );
931 sizer->Add(new wxStaticText(panel,-1,"Layer") );
933 sizer->Add(new wxStaticText(panel,-1,"Cut 1") );
935 // sizer->Add(new wxStaticText(panel,-1,"Cut 2") );
936 // sizer->Add(panel4);
938 panel->SetSizer(sizer);
939 panel->SetAutoLayout(true);
940 panel->SetSize(350,750);
944 Connect(_sl1_box1->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnPositionX );
945 Connect(_sl2_box1->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnPositionY );
946 Connect(_sl3_box1->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnPositionZ );
947 Connect(_chk1_box1->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleX );
948 Connect(_chk2_box1->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleY );
949 Connect(_chk3_box1->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleZ );
953 Connect(_slA1_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnOpacity0 );
954 Connect(_slB1_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnOpacity1 );
955 Connect(_slC1_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnOpacity2 );
956 Connect(_slD1_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnOpacity3 );
957 Connect(_btnA->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxSurfaceMPR::OnBtnColourA );
958 Connect(_btnB->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxSurfaceMPR::OnBtnColourB );
959 Connect(_btnC->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxSurfaceMPR::OnBtnColourC );
960 Connect(_btnD->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxSurfaceMPR::OnBtnColourD );
965 Connect(_slA2_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue0 );
966 Connect(_slA3_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue0 );
967 Connect(_slB2_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue1 );
968 Connect(_slB3_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue1 );
969 Connect(_slC2_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue2 );
970 Connect(_slC3_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue2 );
971 Connect(_slD2_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue3 );
972 Connect(_slD3_box2->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue3 );
973 Connect(_slA2_box2->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue_0 );
974 Connect(_slA3_box2->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue_0 );
975 Connect(_slB2_box2->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue_1 );
976 Connect(_slB3_box2->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue_1 );
977 Connect(_slC2_box2->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue_2 );
978 Connect(_slC3_box2->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue_2 );
979 Connect(_slD2_box2->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue_3 );
980 Connect(_slD3_box2->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxSurfaceMPR::OnIsoValue_3 );
982 Connect(_chkA_box2->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleTissueA );
983 Connect(_chkB_box2->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleTissueB );
984 Connect(_chkC_box2->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleTissueC );
985 Connect(_chkD_box2->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleTissueD );
986 Connect(_chkAA_box2->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleTissueA );
987 Connect(_chkBB_box2->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleTissueB );
988 Connect(_chkCC_box2->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleTissueC );
989 Connect(_chkDD_box2->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleTissueD );
991 Connect(_chk_box3->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleVolume );
992 Connect(_chk_box33->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxSurfaceMPR::OnVisibleVolume );
1003 //------------------------------------------------------------------------
1005 void wxSurfaceMPR::Refresh(){
1006 _vtkmprview[0]->Refresh();
1007 _vtkmprview[1]->Refresh();
1008 _vtkmprview[2]->Refresh();
1009 _vtkmprview[3]->Refresh();
1013 //------------------------------------------------------------------------
1014 void wxSurfaceMPR::OnPositionX(wxScrollEvent& event){
1015 _vtkmpr3Ddata->SetPositionX( _sl1_box1->GetValue() );
1018 //------------------------------------------------------------------------
1019 void wxSurfaceMPR::OnPositionY(wxScrollEvent& event){
1020 _vtkmpr3Ddata->SetPositionY( _sl2_box1->GetValue() );
1023 //------------------------------------------------------------------------
1024 void wxSurfaceMPR::OnPositionZ(wxScrollEvent& event){
1025 _vtkmpr3Ddata->SetPositionZ( _sl3_box1->GetValue() );
1028 //------------------------------------------------------------------------
1029 void wxSurfaceMPR::OpacityTissue(int idView, int idTissue, int opacity){
1031 tmpActor = _vtkmprview[ idView ]->GetTissueActor(idTissue);
1032 tmpActor->GetProperty()->SetOpacity((float) opacity/100 );
1033 _vtkmprview[idView]->Refresh();
1035 //------------------------------------------------------------------------
1036 void wxSurfaceMPR::OnOpacity0(wxScrollEvent& event){
1037 int opacity = _slA1_box2->GetValue();
1038 if (_chkViewA_box2->GetValue()==true){OpacityTissue(0,0, opacity ); }
1039 if (_chkViewB_box2->GetValue()==true){OpacityTissue(1,0, opacity ); }
1040 if (_chkViewC_box2->GetValue()==true){OpacityTissue(2,0, opacity ); }
1041 if (_chkViewD_box2->GetValue()==true){OpacityTissue(3,0, opacity ); }
1043 //------------------------------------------------------------------------
1044 void wxSurfaceMPR::OnOpacity1(wxScrollEvent& event){
1045 int opacity = _slB1_box2->GetValue();
1046 if (_chkViewA_box2->GetValue()==true){OpacityTissue(0,1, opacity ); }
1047 if (_chkViewB_box2->GetValue()==true){OpacityTissue(1,1, opacity ); }
1048 if (_chkViewC_box2->GetValue()==true){OpacityTissue(2,1, opacity ); }
1049 if (_chkViewD_box2->GetValue()==true){OpacityTissue(3,1, opacity ); }
1051 //------------------------------------------------------------------------
1052 void wxSurfaceMPR::OnOpacity2(wxScrollEvent& event){
1053 int opacity = _slC1_box2->GetValue();
1054 if (_chkViewA_box2->GetValue()==true){OpacityTissue(0,2, opacity ); }
1055 if (_chkViewB_box2->GetValue()==true){OpacityTissue(1,2, opacity ); }
1056 if (_chkViewC_box2->GetValue()==true){OpacityTissue(2,2, opacity ); }
1057 if (_chkViewD_box2->GetValue()==true){OpacityTissue(3,2, opacity ); }
1059 //------------------------------------------------------------------------
1060 void wxSurfaceMPR::OnOpacity3(wxScrollEvent& event){
1061 int opacity = _slD1_box2->GetValue();
1062 if (_chkViewA_box2->GetValue()==true){OpacityTissue(0,3, opacity ); }
1063 if (_chkViewB_box2->GetValue()==true){OpacityTissue(1,3, opacity ); }
1064 if (_chkViewC_box2->GetValue()==true){OpacityTissue(2,3, opacity ); }
1065 if (_chkViewD_box2->GetValue()==true){OpacityTissue(3,3, opacity ); }
1067 //------------------------------------------------------------------------
1068 void wxSurfaceMPR::OnIsoValue0(wxScrollEvent& event){
1069 int isoValue=_slA2_box2->GetValue() * 50 + _slA3_box2->GetValue();
1070 _vtkmpr3Ddata->SetIsovalue(0,isoValue);
1072 tmpStr.Printf("%d",isoValue);
1073 _text_A->SetLabel(tmpStr);
1076 //------------------------------------------------------------------------
1077 void wxSurfaceMPR::OnIsoValue1(wxScrollEvent& event){
1078 int isoValue=_slB2_box2->GetValue() * 50 + _slB3_box2->GetValue();
1079 _vtkmpr3Ddata->SetIsovalue(1,isoValue);
1081 tmpStr.Printf("%d",isoValue);
1082 _text_B->SetLabel(tmpStr);
1085 //------------------------------------------------------------------------
1086 void wxSurfaceMPR::OnIsoValue2(wxScrollEvent& event){
1087 int isoValue=_slC2_box2->GetValue() * 50 + _slC3_box2->GetValue();
1088 _vtkmpr3Ddata->SetIsovalue(2,isoValue);
1090 tmpStr.Printf("%d",isoValue);
1091 _text_C->SetLabel(tmpStr);
1094 //------------------------------------------------------------------------
1095 void wxSurfaceMPR::OnIsoValue3(wxScrollEvent& event){
1096 int isoValue=_slD2_box2->GetValue() * 50 + _slD3_box2->GetValue();
1097 _vtkmpr3Ddata->SetIsovalue(3,isoValue);
1099 tmpStr.Printf("%d",isoValue);
1100 _text_D->SetLabel(tmpStr);
1106 //------------------------------------------------------------------------
1107 void wxSurfaceMPR::OnIsoValue_0(wxScrollEvent& event){
1108 int isoValue=_slA2_box2->GetValue() * 50 + _slA3_box2->GetValue();
1110 tmpStr.Printf("%d",isoValue);
1111 _text_A->SetLabel(tmpStr);
1113 //------------------------------------------------------------------------
1114 void wxSurfaceMPR::OnIsoValue_1(wxScrollEvent& event){
1115 int isoValue=_slB2_box2->GetValue() * 50 + _slB3_box2->GetValue();
1117 tmpStr.Printf("%d",isoValue);
1118 _text_B->SetLabel(tmpStr);
1120 //------------------------------------------------------------------------
1121 void wxSurfaceMPR::OnIsoValue_2(wxScrollEvent& event){
1122 int isoValue=_slC2_box2->GetValue() * 50 + _slC3_box2->GetValue();
1124 tmpStr.Printf("%d",isoValue);
1125 _text_C->SetLabel(tmpStr);
1127 //------------------------------------------------------------------------
1128 void wxSurfaceMPR::OnIsoValue_3(wxScrollEvent& event){
1129 int isoValue=_slD2_box2->GetValue() * 50 + _slD3_box2->GetValue();
1131 tmpStr.Printf("%d",isoValue);
1132 _text_D->SetLabel(tmpStr);
1136 //------------------------------------------------------------------------
1137 void wxSurfaceMPR::OnBtnColourA(wxCommandEvent& event){
1138 wxColourDialog dlgColour(this);
1139 dlgColour.ShowModal();
1141 //------------------------------------------------------------------------
1142 void wxSurfaceMPR::OnBtnColourB(wxCommandEvent& event){
1143 wxColourDialog dlgColour(this);
1144 dlgColour.ShowModal();
1146 //------------------------------------------------------------------------
1147 void wxSurfaceMPR::OnBtnColourC(wxCommandEvent& event){
1148 wxColourDialog dlgColour(this);
1149 dlgColour.ShowModal();
1151 //------------------------------------------------------------------------
1152 void wxSurfaceMPR::OnBtnColourD(wxCommandEvent& event){
1153 wxColourDialog dlgColour(this);
1154 dlgColour.ShowModal();
1156 //------------------------------------------------------------------------
1157 void wxSurfaceMPR::VisibleActor(int idView, int idTissue, bool visTissue, bool visGuide){
1158 _vtkmprview[idView]->VisibleActor(idTissue, visTissue, visGuide);
1159 _vtkmprview[idView]->Refresh();
1161 //------------------------------------------------------------------------
1162 void wxSurfaceMPR::VisibleImageActor(int idView, int idTissue, bool visible){
1163 _vtkmprview[idView]->VisibleImageActor(idTissue, visible);
1164 _vtkmprview[idView]->Refresh();
1166 //------------------------------------------------------------------------
1167 void wxSurfaceMPR::OnVisibleX(wxCommandEvent& event){
1168 bool visible = _chk1_box1->GetValue();
1169 if (_chkViewA_box2->GetValue()==true){VisibleImageActor(0,0, visible ); }
1170 if (_chkViewB_box2->GetValue()==true){VisibleImageActor(1,0, visible ); }
1171 if (_chkViewC_box2->GetValue()==true){VisibleImageActor(2,0, visible ); }
1172 if (_chkViewD_box2->GetValue()==true){VisibleImageActor(3,0, visible ); }
1174 //------------------------------------------------------------------------
1175 void wxSurfaceMPR::OnVisibleY(wxCommandEvent& event){
1176 bool visible = _chk2_box1->GetValue();
1177 if (_chkViewA_box2->GetValue()==true){VisibleImageActor(0,1, visible ); }
1178 if (_chkViewB_box2->GetValue()==true){VisibleImageActor(1,1, visible ); }
1179 if (_chkViewC_box2->GetValue()==true){VisibleImageActor(2,1, visible ); }
1180 if (_chkViewD_box2->GetValue()==true){VisibleImageActor(3,1, visible ); }
1182 //------------------------------------------------------------------------
1183 void wxSurfaceMPR::OnVisibleZ(wxCommandEvent& event){
1184 bool visible = _chk3_box1->GetValue();
1185 if (_chkViewA_box2->GetValue()==true){VisibleImageActor(0,2, visible ); }
1186 if (_chkViewB_box2->GetValue()==true){VisibleImageActor(1,2, visible ); }
1187 if (_chkViewC_box2->GetValue()==true){VisibleImageActor(2,2, visible ); }
1188 if (_chkViewD_box2->GetValue()==true){VisibleImageActor(3,2, visible ); }
1190 //------------------------------------------------------------------------
1191 void wxSurfaceMPR::OnVisibleTissueA(wxCommandEvent& event){
1192 bool visiTissue = _chkA_box2->GetValue();
1193 bool visGuide = _chkAA_box2->GetValue();
1194 if (_chkViewA_box2->GetValue()==true){VisibleActor(0,0, visiTissue, visGuide ); }
1195 if (_chkViewB_box2->GetValue()==true){VisibleActor(1,0, visiTissue, visGuide ); }
1196 if (_chkViewC_box2->GetValue()==true){VisibleActor(2,0, visiTissue, visGuide ); }
1197 if (_chkViewD_box2->GetValue()==true){VisibleActor(3,0, visiTissue, visGuide ); }
1199 //------------------------------------------------------------------------
1200 void wxSurfaceMPR::OnVisibleTissueB(wxCommandEvent& event){
1201 bool visiTissue = _chkA_box2->GetValue();
1202 bool visGuide = _chkAA_box2->GetValue();
1203 if (_chkViewA_box2->GetValue()==true){VisibleActor(0,1, visiTissue, visGuide ); }
1204 if (_chkViewB_box2->GetValue()==true){VisibleActor(1,1, visiTissue, visGuide ); }
1205 if (_chkViewC_box2->GetValue()==true){VisibleActor(2,1, visiTissue, visGuide ); }
1206 if (_chkViewD_box2->GetValue()==true){VisibleActor(3,1, visiTissue, visGuide ); }
1208 //------------------------------------------------------------------------
1209 void wxSurfaceMPR::OnVisibleTissueC(wxCommandEvent& event){
1210 bool visiTissue = _chkA_box2->GetValue();
1211 bool visGuide = _chkAA_box2->GetValue();
1212 if (_chkViewA_box2->GetValue()==true){VisibleActor(0,2, visiTissue, visGuide ); }
1213 if (_chkViewB_box2->GetValue()==true){VisibleActor(1,2, visiTissue, visGuide ); }
1214 if (_chkViewC_box2->GetValue()==true){VisibleActor(2,2, visiTissue, visGuide ); }
1215 if (_chkViewD_box2->GetValue()==true){VisibleActor(3,2, visiTissue, visGuide ); }
1217 //------------------------------------------------------------------------
1218 void wxSurfaceMPR::OnVisibleTissueD(wxCommandEvent& event){
1219 bool visiTissue = _chkA_box2->GetValue();
1220 bool visGuide = _chkAA_box2->GetValue();
1221 if (_chkViewA_box2->GetValue()==true){VisibleActor(0,3, visiTissue, visGuide ); }
1222 if (_chkViewB_box2->GetValue()==true){VisibleActor(1,3, visiTissue, visGuide ); }
1223 if (_chkViewC_box2->GetValue()==true){VisibleActor(2,3, visiTissue, visGuide ); }
1224 if (_chkViewD_box2->GetValue()==true){VisibleActor(3,3, visiTissue, visGuide ); }
1226 //------------------------------------------------------------------------
1227 void wxSurfaceMPR::VisibleVolumeActor(int idView, bool visVolume, bool visGuide){
1228 _vtkmprview[idView]->VisibleVolumeActor( visVolume,visGuide);
1229 _vtkmprview[idView]->Refresh();
1231 //------------------------------------------------------------------------
1232 void wxSurfaceMPR::OnVisibleVolume(wxCommandEvent& event){
1233 bool visVolume = _chk_box3->GetValue();
1234 bool visGuide = _chk_box33->GetValue();
1235 if (_chkViewA_box2->GetValue()==true){VisibleVolumeActor(0, visVolume, visGuide); }
1236 if (_chkViewB_box2->GetValue()==true){VisibleVolumeActor(1, visVolume, visGuide); }
1237 if (_chkViewC_box2->GetValue()==true){VisibleVolumeActor(2, visVolume, visGuide); }
1238 if (_chkViewD_box2->GetValue()==true){VisibleVolumeActor(3, visVolume, visGuide); }
1241 //------------------------------------------------------------------------
1242 void wxSurfaceMPR::ConfigureVTK(){
1243 _vtkmprview[0]->Configure();
1244 _vtkmprview[1]->Configure();
1245 _vtkmprview[2]->Configure();
1246 _vtkmprview[3]->Configure();