//wxCheckBox *ckVolum = new wxCheckBox(panel,-1,_T("Vol"));
wxCheckBox *ckBoxSurface = new wxCheckBox(panel,-1,_T("Surface Box"));
//wxCheckBox *ckVolum = new wxCheckBox(panel,-1,_T("Vol"));
wxCheckBox *ckBoxSurface = new wxCheckBox(panel,-1,_T("Surface Box"));
//wxCheckBox *ckBoxVolume = new wxCheckBox(panel,-1,_T("Volume Box"));
_color = new wxButton(panel,-1,_T(""));
//wxCheckBox *ckBoxVolume = new wxCheckBox(panel,-1,_T("Volume Box"));
_color = new wxButton(panel,-1,_T(""));
_isoValueSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
_isoValueSpin->SetRange(1,8);
_isoValueSpin->SetValue(5);
_isoValueSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
_isoValueSpin->SetRange(1,8);
_isoValueSpin->SetValue(5);
- Connect(_isoValueSpin->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnIsoValueSpin );
+ Connect(_isoValueSpin->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnIsoValueSpin );
wxButton *btnSTL = new wxButton(panel,-1,_T("Create STL File"));
wxButton *btnSaveRaw = new wxButton(panel,-1,_T("Save Raw Volume"));
wxButton *btnSTL = new wxButton(panel,-1,_T("Create STL File"));
wxButton *btnSaveRaw = new wxButton(panel,-1,_T("Save Raw Volume"));
- Connect(btnSTL->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnCreateFileSTL );
- Connect(btnSaveRaw->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnSaveRawVolume );
-
- //RaC 03-2010 Divides in two panels thje last tab Surface/Volume
- //Connect(btnVolumeFunctions->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions );
+ Connect(btnSTL->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnCreateFileSTL );
+ Connect(btnSaveRaw->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnSaveRawVolume );
+
+ //RaC 03-2010 Divides in two panels thje last tab Surface/Volume
+ //Connect(btnVolumeFunctions->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions );
- Connect(btnMeshVTKLoad->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad );
+ Connect(btnMeshVTKLoad->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad );
// _positionY->SetSize(400,20);
// _positionZ->SetSize(400,20);
// _positionY->SetSize(400,20);
// _positionZ->SetSize(400,20);
//Connect(ckVolum->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnVisibleVolume );
//Connect(ckBoxVolume->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume );
//Connect(ckVolum->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnVisibleVolume );
//Connect(ckBoxVolume->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume );
//wxFlexGridSizer *sizerH5 = new wxFlexGridSizer(10); // JPRx
//wxFlexGridSizer *sizerH6 = new wxFlexGridSizer(10); // JPRx
//wxFlexGridSizer *sizerH5 = new wxFlexGridSizer(10); // JPRx
//wxFlexGridSizer *sizerH6 = new wxFlexGridSizer(10); // JPRx
//sizerH0->Add( ckVolum , 1, wxALL|wxEXPAND, 0);
//sizerH0->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
//sizerH0->Add( ckBoxVolume , 1, wxALL|wxEXPAND, 0);
//sizerH0->Add( ckVolum , 1, wxALL|wxEXPAND, 0);
//sizerH0->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
//sizerH0->Add( ckBoxVolume , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( _visible , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( _visible , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( _wireFrameRep , 1,wxSHAPED | wxALIGN_CENTER_VERTICAL , 0);
sizerH2->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( _surfaceRep , 1,wxSHAPED | wxALIGN_CENTER_VERTICAL , 0);
sizerH2->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( _wireFrameRep , 1,wxSHAPED | wxALIGN_CENTER_VERTICAL , 0);
sizerH2->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( _surfaceRep , 1,wxSHAPED | wxALIGN_CENTER_VERTICAL , 0);
sizerH2->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( _opacity , 1, wxALL|wxEXPAND, 0);
sizerH2->Add( _opacity , 1, wxALL|wxEXPAND, 0);
_opacity->SetValue( (int)(tmpActor->GetProperty()->GetOpacity()*100) );
// Representation Type WireFrame / Surface
_opacity->SetValue( (int)(tmpActor->GetProperty()->GetOpacity()*100) );
// Representation Type WireFrame / Surface
- _surfaceRep->SetValue(_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetRepresentationType(idTissue));
- _wireFrameRep->SetValue(!_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetRepresentationType(idTissue));
+ _surfaceRep->SetValue(_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetRepresentationType(idTissue));
+ _wireFrameRep->SetValue(!_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetRepresentationType(idTissue));
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume(wxCommandEvent& event)
{
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume(wxCommandEvent& event)
{
- _wxvtkclipping3Dview->SetVisibleBoxVolume(event.IsChecked() );
+printf("EED ERROR JPReyes wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume calling _wxvtkclipping3Dview->SetVisibleBoxVolume that not exists ...");
+//EED01July2011 _wxvtkclipping3Dview->SetVisibleBoxVolume(event.IsChecked() );
+ //this->BoundingBoxChanged(event.IsChecked());
_wxvtkclipping3Dview->Refresh();
}
//-------------------------------------------------------------------
_wxvtkclipping3Dview->Refresh();
}
//-------------------------------------------------------------------
_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->SetIsovalue(idTissue,isoValue);
// wxString tmpStr;
// tmpStr.Printf("%d",isoValue);
_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->SetIsovalue(idTissue,isoValue);
// wxString tmpStr;
// tmpStr.Printf("%d",isoValue);
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
wxString dirSTL = wxGetHomeDir( ) ;
wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxSAVE );
wxString dirSTL = wxGetHomeDir( ) ;
wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxSAVE );
// ------------------------------------------------------------------------
// 1. GENERATE STL FILES
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// 1. GENERATE STL FILES
// ------------------------------------------------------------------------
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event)
{
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event)
{
int /*i=0,*/ xi,yi,r,g,b; // JPRx
vtkColorTransferFunction* ctfun = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetColorTransferenceFunction();
vtkPiecewiseFunction* tfun = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTransferencefunction();
int /*i=0,*/ xi,yi,r,g,b; // JPRx
vtkColorTransferFunction* ctfun = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetColorTransferenceFunction();
vtkPiecewiseFunction* tfun = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTransferencefunction();
wxFileDialog dialog(this, _T("Choose a file"), _T("c:/Maracas_configuration"),_T(""), _T("*.MarVolConf"), wxOPEN);
if (dialog.ShowModal() == wxID_OK)
{
_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions( (char *)dialog.GetPath().c_str() );
wxFileDialog dialog(this, _T("Choose a file"), _T("c:/Maracas_configuration"),_T(""), _T("*.MarVolConf"), wxOPEN);
if (dialog.ShowModal() == wxID_OK)
{
_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions( (char *)dialog.GetPath().c_str() );
}
*/
HistogramDialog* hDlg=new HistogramDialog(NULL,_T("Histogram Dialog"),imagedata,1);
}
*/
HistogramDialog* hDlg=new HistogramDialog(NULL,_T("Histogram Dialog"),imagedata,1);
while(i<nCTFpoints)
{
hDlg->getDataBarColorPoint(i,xi,r,g,b);
while(i<nCTFpoints)
{
hDlg->getDataBarColorPoint(i,xi,r,g,b);
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
double blue = (*bctf)[i];
ctfun->AddRGBPoint(grey2,red,green,blue);
}
double blue = (*bctf)[i];
ctfun->AddRGBPoint(grey2,red,green,blue);
}
//---------------------------------
// Refreshing and sending the event
//---------------------------------
//---------------------------------
// Refreshing and sending the event
//---------------------------------
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);