: 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");
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 =
interfThresholdPanel::interfThresholdPanel(wxWindow* parent)
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
{
- wxButton *thresholdGoBtn = new wxButton(this,wxID_ANY,_T("Add Fake Color"), wxDefaultPosition, wxSize(200,30) );
- wxButton *thresholdRemoveBtn = new wxButton(this,wxID_ANY,_T("Remove Fake Color"), wxDefaultPosition, wxSize(200,30) );
+ wxButton *thresholdGoBtn = new wxButton(this,wxID_ANY,_T("Show/Hide Color"), wxDefaultPosition, wxSize(200,30) );
_interpolationCheckBox = new wxCheckBox(this, -1, _T("Image interpolation") );
_interpolationCheckBox->SetValue(true);
_opacity = new wxSlider(this, wxID_ANY, 6, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
_mBarThreshold-> SetEnd( max );
Connect( thresholdGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfThresholdPanel::onThresholdGo );
- Connect( thresholdRemoveBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfThresholdPanel::onThresholdRemove );
Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfThresholdPanel::onThresholdInterpolation );
wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
sizer -> Add( _opacity, 1, wxGROW );
sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW );
sizer -> Add( thresholdGoBtn, 1, wxGROW );
- sizer -> Add( thresholdRemoveBtn, 1, wxGROW );
sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW );
sizer -> Add( _interpolationCheckBox, 1, wxGROW );
{
if (_thresholdGo)
{
- int minVal = _mBarThreshold->GetStart();
- int maxVal = _mBarThreshold->GetEnd();
-
- interfMainPanel::getInstance()->onThresholdChange(minVal, maxVal);
+ interfMainPanel::getInstance()->onThresholdChange();
//std::cout<< "Valor Min: " << minVal << " & Valor Max: " << maxVal << std::endl;
}
{
if (!_thresholdGo)
{
- int minVal = _mBarThreshold->GetStart();
- int maxVal = _mBarThreshold->GetEnd();
-
- interfMainPanel::getInstance()->onThreshold(minVal, maxVal);
+ interfMainPanel::getInstance()->onThreshold();
_thresholdGo=true;
}
-}
-
-void interfThresholdPanel::onThresholdRemove(wxCommandEvent& event)
-{
- interfMainPanel::getInstance()->onThresholdRemove( );
- _thresholdGo=false;
+ else
+ {
+ interfMainPanel::getInstance()->onThresholdRemove( );
+ _thresholdGo=false;
+ }
}
void interfThresholdPanel::onThresholdStop()
{
- interfMainPanel::getInstance()->onThresholdRemove( );
- _thresholdGo=false;
+ if (_thresholdGo)
+ {
+ interfMainPanel::getInstance()->onThresholdRemove( );
+ _thresholdGo=false;
+ }
}
-void interfThresholdPanel::onThresholdInstantChange(int range[])
+void interfThresholdPanel::onThresholdInstantChange(double range[])
{
range[0] = _mBarThreshold->GetStart();
range[1] = _mBarThreshold->GetEnd();