int maxY = _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetMaxPositionY();
int maxZ = _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetMaxPositionZ();*/
- int maxX = 1;
- int maxY = 1;
- int maxZ = 1;
+ //int maxX = 1;
+ //int maxY = 1;
+ //int maxZ = 1;
//CPR: Modified 30 Nov 2009
/*
*/
ckBoxX = new wxCheckBox(panel,-1,_T("X "));
- _positionX = new wxSlider(panel,-1,maxX/2,0,maxX, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionX = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
ckBoxY = new wxCheckBox(panel,-1,_T("Y "));
- _positionY = new wxSlider(panel,-1,maxY/2,0,maxY, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionY = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
ckBoxZ = new wxCheckBox(panel,-1,_T("Z "));
- _positionZ = new wxSlider(panel,-1,maxZ/2,0,maxZ, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionZ = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
wxButton *btnColorTable = new wxButton (panel, -1, _T("Color Table") );
_ckBoxXYZ = new wxCheckBox(panel,-1,_T("Show XYZ axis "));
panel->Layout();
panel->SetEventHandler((wxEvtHandler*)this);
-
+
//this->UpdateControlPanel();
}
void wxVtkMPR3DViewCntrlPanel::UpdateControlPanel()
/*int maxX = basedata->GetMaxPositionX();
int maxY = basedata->GetMaxPositionY();
int maxZ = basedata->GetMaxPositionZ();*/
+ vtkImageData* img = basedata->GetImageData();
int x0,x1,y0,y1,z0,z1;
-
- basedata->GetDimensionExtention(&x0,&x1,&y0,&y1,&z0,&z1);
/*int maxX = x1-x0;//basedata->GetMaxPositionX();
int maxY = y1-y0;//basedata->GetMaxPositionY();
int maxZ = z1-z0;//basedata->GetMaxPositionZ();*/
/*_positionX->SetRange(0,maxX);
_positionY->SetRange(0,maxY);
_positionZ->SetRange(0,maxZ);*/
- _positionX->SetRange(x0,x1);
- _positionY->SetRange(y0,y1);
- _positionZ->SetRange(z0,z1);
-
- _positionX->SetValue((x0+x1)/2);
- _positionY->SetValue((y0+y1)/2);
- _positionZ->SetValue((z0+z1)/2);
-
- _positionX->Update();
- _positionY->Update();
- _positionZ->Update();
- this->Update();
+ if(img){
+ img->GetExtent(x0,x1,y0,y1,z0,z1);
+ _positionX->SetRange(x0,x1);
+ _positionY->SetRange(y0,y1);
+ _positionZ->SetRange(z0,z1);
+
+ _positionX->SetValue((x0+x1)/2);
+ _positionY->SetValue((y0+y1)/2);
+ _positionZ->SetValue((z0+z1)/2);
+
+ _positionX->Update();
+ _positionY->Update();
+ _positionZ->Update();
+ this->Update();
+ }
+
}
}