+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
#include "interfSegmentationPanels.h"
#include "interfMainPanel.h"
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
{
int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
- //int sizeZ = _theViewPanel->getSceneManager()->GetImageDataSizeZ();
+
double range[2];
- //_theViewPanel->getSceneManager()->GetImageDataRange(range);
- interfMainPanel::getInstance()->GetImageDataRange(range);
+ interfMainPanel::getInstance()->getImageRange(range);
+
+ int min = (int)floor (range[0]);
+ int max = (int)ceil (range[1]);
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) );
- _isovalue = new wxSlider(this, -1, 40 , (int)(range[0]), (int)(range[1]), wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+ _isovalue = new wxSlider(this, -1, 40 , min, max, 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];
lstOptions[0]=_T("A");
methodRadiobox->SetSelection(2);
_staticTextSegmentation = new wxStaticText(this,-1,_T(" "));
- _mbarrange = new mBarRange(this,70, 65);
+ _mbarrange = new mBarRange(this,70, 65);
_mbarrange->SetMin(0);
_mbarrange->SetStart(0);
interfSegmentationPanelITK::interfSegmentationPanelITK(wxWindow * parent)
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
{
- int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
- //int sizeZ = _theViewPanel->getSceneManager()->GetImageDataSizeZ();
double range[2];
- //_theViewPanel->getSceneManager()->GetImageDataRange(range);
- interfMainPanel::getInstance()->GetImageDataRange(range);
+ interfMainPanel::getInstance()->getImageRange(range);
+
+// int min = (int)floor (range[0]);
+// int max = (int)ceil (range[1]);
//The labels
- wxStaticText * distance = new wxStaticText(this, wxID_ANY, wxT("Initial Distance"), wxPoint(5, 5));
- wxStaticText * sigma = new wxStaticText(this, wxID_ANY, wxT("Sigma"), wxPoint(5, 30));
- wxStaticText * alfa = new wxStaticText(this, wxID_ANY, wxT("Sigmoid Alfa"), wxPoint(5, 55));
- wxStaticText * beta = new wxStaticText(this, wxID_ANY, wxT("Sigmoid Beta"), wxPoint(5, 80));
- wxStaticText * propagation = new wxStaticText(this, wxID_ANY, wxT("Propagation Scaling"),wxPoint(5, 105));
- wxStaticText * iterations = new wxStaticText(this, wxID_ANY, wxT("Iterations"), wxPoint(5, 130));
- wxStaticText * infStrength = new wxStaticText(this, wxID_ANY, wxT("Inflation Strength"), wxPoint(5, 155));
+ //wxStaticText * distance =
+ new wxStaticText(this, wxID_ANY, wxT("Initial Distance"), wxPoint(5, 5));
+ //wxStaticText * sigma =
+ new wxStaticText(this, wxID_ANY, wxT("Sigma"), wxPoint(5, 30));
+ //wxStaticText * alfa =
+ new wxStaticText(this, wxID_ANY, wxT("Sigmoid Alfa"), wxPoint(5, 55));
+ //wxStaticText * beta =
+ new wxStaticText(this, wxID_ANY, wxT("Sigmoid Beta"), wxPoint(5, 80));
+ //wxStaticText * propagation =
+ new wxStaticText(this, wxID_ANY, wxT("Propagation Scaling"),wxPoint(5, 105));
+ //wxStaticText * iterations =
+ new wxStaticText(this, wxID_ANY, wxT("Iterations"), wxPoint(5, 130));
+ //wxStaticText * infStrength =
+ new wxStaticText(this, wxID_ANY, wxT("Inflation Strength"), wxPoint(5, 155));
//Text Controls
_infStrength = new wxTextCtrl(this, wxID_ANY, wxT("3.0"), wxPoint(98,155), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
//El boton
- wxButton * bot = new wxButton(this, 6, wxT("One Slice"), wxPoint(98, 180), wxSize(70, 25), 0, wxDefaultValidator, wxT("button"));
+ //wxButton * bot =
+ new wxButton(this, 6, wxT("One Slice"), wxPoint(98, 180), wxSize(70, 25), 0, wxDefaultValidator, wxT("button"));
//Conexion del boton con su respectivo manejador
Connect(6, wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &interfSegmentationPanelITK::onSegmentationOneSlice);
interfMirrorPanel::interfMirrorPanel(wxWindow* parent)
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
{
- wxButton *mirrorGoBtn = new wxButton(this,-1,_T("Go"), wxDefaultPosition, wxSize(200,35) );
- _thickness = new wxSlider(this, -1, 4, 1, 10, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+ _axisStatus = true;
+
+ wxButton *axisShowBtn = new wxButton(this,wxID_ANY,_T("Show/Hide Axis"), wxDefaultPosition, wxSize(200,35) );
+ wxButton *mirrorGoBtn = new wxButton(this,wxID_ANY,_T("Mirror Contour"), wxDefaultPosition, wxSize(200,35) );
+ _thickness = new wxSlider(this, -1, 4, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
- Connect( mirrorGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onMirrorGo );
+ Connect( axisShowBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onAxisShow );
+ Connect( mirrorGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onMirrorGo );
wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ sizer -> Add( axisShowBtn, 1, wxGROW );
+ sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW );
sizer -> Add( new wxStaticText(this,-1,_T("Thickness")) , 1, wxGROW );
sizer -> Add( _thickness, 1, wxGROW );
sizer -> Add( mirrorGoBtn, 1, wxGROW );
interfMirrorPanel::~interfMirrorPanel(){
}
+void interfMirrorPanel::onAxisShow(wxCommandEvent& event)
+{
+
+ if (!_axisStatus)
+ {
+ interfMainPanel::getInstance()->onMirrorAxisShow();
+ _axisStatus=true;
+ }
+ else
+ {
+ interfMainPanel::getInstance()->onMirrorAxisHide();
+ _axisStatus=false;
+ }
+}
+
void interfMirrorPanel::onMirrorGo(wxCommandEvent& event)
{
- interfMainPanel::getInstance()->onMirror();
+ if (_axisStatus)
+ {
+ interfMainPanel::getInstance()->onMirror();
+ }
}
void interfMirrorPanel::onChangeWidth(wxScrollEvent& event)
-/**
-** Begin of the threshold panel
-**/
-interfThresholdPanel::interfThresholdPanel(wxWindow* parent)
-: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
-{
- wxButton *thresholdGoBtn = new wxButton(this,-1,_T("Threshold Go"), wxDefaultPosition, wxSize(200,30) );
- _thresholdGo = false;
- double range[2];
- interfMainPanel::getInstance()->getImageRange(range);
+
+
+BEGIN_EVENT_TABLE(interfMirrorPanel, wxPanel)
+EVT_SCROLL(interfMirrorPanel :: onChangeWidth)
+END_EVENT_TABLE()
+
+//////////////////////////////////////////////////////////////
+
+interfTestPanel::interfTestPanel(wxWindow* parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+ wxButton *button1 = new wxButton(this,wxID_ANY,_T("Button 1"), wxDefaultPosition, wxSize(200,35) );
+ wxButton *button2 = new wxButton(this,wxID_ANY,_T("Button 2"), wxDefaultPosition, wxSize(200,35) );
- _mBarThreshold = new mBarRange(this,70,65);
- _mBarThreshold->SetMin(0);
- _mBarThreshold->SetStart(0);
- _mBarThreshold-> SetOrientation( true );
- _mBarThreshold-> setActiveStateTo(true);
- _mBarThreshold-> setVisibleLabels( true );
- _mBarThreshold-> setDeviceEndMargin(10);
- _mBarThreshold-> setRepresentedValues( range[0] , range[1] );
- _mBarThreshold-> setDeviceBlitStart(10,10);
- _mBarThreshold-> setIfWithActualDrawed( false );
- _mBarThreshold-> SetStart( range[0] );
- _mBarThreshold-> SetEnd( range[1] );
+ Connect( button1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfTestPanel::onButton1Pressed );
+ Connect( button2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfTestPanel::onButton2Pressed );
- Connect( thresholdGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfThresholdPanel::onThresholdGo );
-
wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
- sizer -> Add( _mBarThreshold, 1, wxGROW );
- sizer -> Add( thresholdGoBtn, 1, wxGROW );
- sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW );
- sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW );
- //sizer -> Add( new wxStaticText(this,-1,_T("Select the image's range to superpose a Fake Color")) , 1, wxGROW );
-
+ sizer -> Add( button1, 1, wxGROW );
+ sizer -> Add( button2, 1, wxGROW );
this->SetSizer( sizer );
this->SetAutoLayout( true );
this->Layout();
}
-interfThresholdPanel::~interfThresholdPanel(){
-}
-
-
-
-void interfThresholdPanel::onThresholdChange(wxCommandEvent& event)
-{
- if (_thresholdGo)
- {
- int minVal = _mBarThreshold->GetStart();
- int maxVal = _mBarThreshold->GetEnd();
-
- interfMainPanel::getInstance()->onThreshold(minVal, maxVal);
-
- std::cout<< "Valor Min: " << minVal << " & Valor Max: " << maxVal << std::endl;
- }
+interfTestPanel::~interfTestPanel(){
}
-void interfThresholdPanel::onThresholdGo(wxCommandEvent& event)
+void interfTestPanel::onButton1Pressed(wxCommandEvent& event)
{
- if (!_thresholdGo)
- {
- int minVal = _mBarThreshold->GetStart();
- int maxVal = _mBarThreshold->GetEnd();
-
- interfMainPanel::getInstance()->onThreshold(minVal, maxVal);
- _thresholdGo=true;
- }
+ std::cout << "Button 1 has been pressed" << std::endl;
}
-void interfThresholdPanel::onThresholdStop()
+void interfTestPanel::onButton2Pressed(wxCommandEvent& event)
{
- _thresholdGo=false;
+ std::cout << "Button 2 has been pressed" << std::endl;
}
-
-
-BEGIN_EVENT_TABLE(interfMirrorPanel, wxPanel)
- EVT_SCROLL(interfMirrorPanel :: onChangeWidth)
-END_EVENT_TABLE()
-
-BEGIN_EVENT_TABLE(interfThresholdPanel, wxPanel)
- EVT_COMMAND(wxID_ANY, wxEVT_TSBAR_START, interfThresholdPanel :: onThresholdChange)
- EVT_COMMAND(wxID_ANY, wxEVT_TSBAR_END, interfThresholdPanel :: onThresholdChange)
- EVT_COMMAND(wxID_ANY, wxEVT_TSBAR_MOVED, interfThresholdPanel :: onThresholdChange)
-END_EVENT_TABLE()
-
-