return ((interfInformationPanel*)informationPanel)->getCellValue(j, i );
}
+void interfMainPanel::onSnakePressed(){
+ wxContourMainFrame::getInstance()->onSnakePressed();
+}
void onSaveResults(std::string directory,std::string namefile, std::string filename,int typeContourGroup);
wxString getCellValue(int j,int i);
+
+ void onSnakePressed();
private:
void interfSegmentationMenu::onSnakePressed(wxCommandEvent& event){
- //contourevent->onSnakePressed(this);
+ interfMainPanel::getInstance()->onSnakePressed();
}
//axisshown = true;
}
-void interfSegmentationPanelVTK::onSnakePressed(wxCommandEvent& event){
-
- //contourevent->onSnakePressed(this);
-
-}
void interfSegmentationPanelVTK::onSegmentationOneSlice( wxCommandEvent& event )
{
wxButton *segmentationOneSliceBtn = new wxButton(this,-1,_T("Current slice"), wxDefaultPosition, wxSize(200,35) );
wxButton *segmentationAllSliceBtn = new wxButton(this,-1,_T("All slices") ,wxDefaultPosition, wxSize(200,35) );
+
+ Connect( segmentationOneSliceBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSegmentationPanelITK::onSegmentationOneSlice);
+ Connect( segmentationAllSliceBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSegmentationPanelITK::onSegmentationAllSlice);
+
_isovalue = new wxSlider(this, -1, 40 , (int)(range[0]), (int)(range[1]), wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
_sampling = new wxSlider(this, -1, 20 , 4, 50, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
wxString lstOptions[3];
}
interfSegmentationPanelITK::~interfSegmentationPanelITK(){
+}
+
+void interfSegmentationPanelITK::onSegmentationOneSlice( wxCommandEvent& event )
+{
+
+
+ /*int isovalue = _isovalue->GetValue();
+ int sampling = _sampling->GetValue();
+ int method = methodRadiobox->GetSelection();
+ interfMainPanel::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);*/
+
+}
+void interfSegmentationPanelITK::onSegmentationAllSlice( wxCommandEvent& event )
+{
+
+ /*int minZ=_mbarrange->GetStart();
+ int maxZ=_mbarrange->GetEnd();
+
+ int isovalue = _isovalue->GetValue();
+ int sampling = _sampling->GetValue();
+ int method = methodRadiobox->GetSelection();
+
+
+ interfMainPanel::getInstance()->onSegmentationAllSlice(minZ, maxZ, isovalue, sampling, method);*/
+
}
//------------------------------------------------------------------------------------------------------------
void onSegmentationPressedITK(wxCommandEvent& event);
- void onSnakePressed(wxCommandEvent& event);
-
void setLabel(wxString tmpString);
private:
interfSegmentationPanelITK(wxWindow * parent);
~interfSegmentationPanelITK();
+
+ void onSegmentationOneSlice( wxCommandEvent& event );
+
+ void onSegmentationAllSlice( wxCommandEvent& event );
private:
nom.push_back("Configuration of the window");
funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onConfigurationPressed);
+ path.push_back(datadir + "/Help.png");
+ nom.push_back("Show help page with information about the tools");
+ funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onHelpPressed);
+
this->addButtons(path, nom);
this->setVectorFunction(funct);
}
+void interfToolsMenu::onHelpPressed(wxCommandEvent& event){
+ wxLaunchDefaultBrowser("http://www.creatis.insa-lyon.fr/creatools/node/25", 0);
+}
+
#define __interfToolsMenuH__
#include <wx/wx.h>
+#include <wx/utils.h>
#include "interfMenuBar.h"
void onConfigurationPressed(wxCommandEvent& event);
+ void onHelpPressed(wxCommandEvent& event);
+
private:
//wxContourEventHandler* contourevent;
vtkImageData* img = kernelManager->getImageAtInstant(inst);
if(img!=NULL){
_theViewPanel->changeImage(img);
- }
+ }else{
+ int z = _instantPanel->getConceptDataOf("Axe Depth")->getActualValue();
+ _theViewPanel->setImageSlice(z);
+ }
}
void wxContourMainFrame::updateInstantAxes(){
}
changeInstant();
}
+
+void wxContourMainFrame::onSnakePressed(){
+ std::vector<double> vecX;
+ std::vector<double> vecY;
+ std::vector<double> vecZ;
+ _theViewPanel->GetPointsOfActualContour( &vecX , &vecY , &vecZ );
+
+ if (vecX.size()!=0){
+ std::vector<int> tempVector;
+ _instantPanel->getInstant( tempVector );
+ int i,size=vecZ.size();
+ int actualSlice = tempVector[1];
+ for ( i=0 ; i<size ; i++ )
+ {
+ vecZ[i] = actualSlice;
+ } // for
+
+ wxDialog* dialog = new wxDialog(this, -1, wxString(_T("Snake")));
+ wxPanel* panel = new wxPanel(dialog,-1);
+ wxStaticText* sttext = new wxStaticText(panel, -1, wxString(_T("Panel para snake")));
+ dialog->ShowModal();
+ } // if
+
+}
void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
+ void onSnakePressed();
private:
//------------------------------------------------------------------------------------------------------------
// Private methods
}
void wxContourViewPanel::onChangedDeep (wxCommandEvent& event){
double val = getCurrentDeep();
- setActualVertical( (int)val );
+ //setActualVertical( (int)val );
wxContourMainFrame::getInstance()->onChangeDeep((int)val);
//_instantPanel->setConceptValue( "Axe Depth", (int)val );
// changeInstant();
}
+ void wxContourViewPanel::changeDeep(){
+ double val = getCurrentDeep();
+ setActualVertical( (int)val );
+ }
void wxContourViewPanel::onActionButtonPressed(wxCommandEvent& event){
}
void wxContourViewPanel::GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ ){
_sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ);
+ }
+
+ void wxContourViewPanel::setImageSlice(int z){
+ _sceneManager->getWxVtkViewBase()->GetInteractorStyleBaseView()->GetWxVtk2DBaseView()->SetActualSlice(z);
+ RefreshInterface();
}
\ No newline at end of file
void GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ );
void changeImage(vtkImageData* img);
+
+ void changeDeep();
+
+ void setImageSlice(int z);
private:
//------------------------------------------------------------------------------------------------------------
_lastInteractionName = iter->first;
viewer->UpdateColorActor();
- control->SetPosibleToMove( true );
+ control->SetPosibleToMove( true );
// viewer->AddCompleteContourActor();
}
iter++;
return vectimages;
}
void KernelManagerContour::setVectImages(std::vector<vtkImageData*> vectimg){
+
+ for(int i = 0; i < vectimg.size(); i++){
+ vtkImageData* img = vectimg[i];
+ vtkImageChangeInformation* change = vtkImageChangeInformation::New();
+ change->SetInformationInput(img);
+ change->SetInputConnection(img->GetProducerPort());
+
+ change->SetOutputSpacing(0.6,0.6,0.6);
+
+ change->Update();
+
+ vectimg[i] = change->GetOutput();
+ }
+
vectimages = vectimg;
}
#include "ContourPropagation.h"
+#include <vtkImageChangeInformation.h>
class KernelManagerContour{