creaContours_lib
interfSegmentationPanelVTK Class Reference

#include <interfSegmentationPanels.h>

Inheritance diagram for interfSegmentationPanelVTK:
Collaboration diagram for interfSegmentationPanelVTK:

Public Member Functions

 interfSegmentationPanelVTK (wxWindow *parent)
 
 ~interfSegmentationPanelVTK ()
 
void onSegmentationPressed (wxCommandEvent &event)
 
void onSegmentationPressedITK (wxCommandEvent &event)
 
void setLabel (wxString tmpString)
 

Private Member Functions

void hideAxis ()
 
wxPanel * getSegmentationPanel (wxWindow *parent)
 
void onSegmentationOneSlice (wxCommandEvent &event)
 
void onSegmentationAllSlice (wxCommandEvent &event)
 

Private Attributes

wxPanel * configPanel
 
wxWindow * infoWin
 
wxPanel * segmentPanel
 
wxPanel * spreadPanel
 
wxPanel * segmentPanelITK
 
bool axisshown
 
wxSlider * _isovalue
 
mBarRange * _mbarrange
 
wxSlider * _sampling
 
wxStaticText * _staticTextSegmentation
 
wxRadioBox * methodRadiobox
 

Detailed Description

Definition at line 33 of file interfSegmentationPanels.h.

Constructor & Destructor Documentation

interfSegmentationPanelVTK::interfSegmentationPanelVTK ( wxWindow *  parent)

Definition at line 29 of file interfSegmentationPanels.cxx.

References _isovalue, _mbarrange, _sampling, _staticTextSegmentation, interfMainPanel::GetImageDataSizeZ(), interfMainPanel::getImageRange(), interfMainPanel::getInstance(), methodRadiobox, onSegmentationAllSlice(), and onSegmentationOneSlice().

30 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
31 {
33 
34  double range[2];
36 
37  int min = (int)floor (range[0]);
38  int max = (int)ceil (range[1]);
39 
40  wxButton *segmentationOneSliceBtn = new wxButton(this,-1,_T("Current slice"), wxDefaultPosition, wxSize(200,35) );
41  wxButton *segmentationAllSliceBtn = new wxButton(this,-1,_T("All slices") ,wxDefaultPosition, wxSize(200,35) );
42  _isovalue = new wxSlider(this, -1, 40 , min, max, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
43  _sampling = new wxSlider(this, -1, 20 , 4, 50, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
44  wxString lstOptions[3];
45  lstOptions[0]=_T("A");
46  lstOptions[1]=_T("B");
47  lstOptions[2]=_T("C");
48  methodRadiobox = new wxRadioBox(this, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxSize(200,45), 3 , lstOptions, 3, wxRA_SPECIFY_COLS);
49  methodRadiobox->SetSelection(2);
50  _staticTextSegmentation = new wxStaticText(this,-1,_T(" "));
51 
52  _mbarrange = new mBarRange(this,70, 65);
53  _mbarrange->SetMin(0);
54  _mbarrange->SetStart(0);
55 
56  _mbarrange->SetOrientation( true );
57  _mbarrange->setActiveStateTo(true);
58  _mbarrange->setVisibleLabels( true );
59  _mbarrange->setDeviceEndMargin(10);
60  _mbarrange->setRepresentedValues( 0 , sizeZ );
61  _mbarrange->setDeviceBlitStart(10,10);
62  _mbarrange->setIfWithActualDrawed( false );
63  _mbarrange->SetStart( 0 );
64  _mbarrange->SetEnd( sizeZ );
65 
66  wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
67  sizer->Add( new wxStaticText(this, -1, _T("Isovalue (Gray level)")), 1, wxGROW );
68  sizer->Add( _isovalue, 1, wxGROW );
69  sizer->Add( methodRadiobox , 1, wxGROW );
70  sizer->Add( new wxStaticText(this, -1 ,_T("Sampling (%)")), 1, wxGROW );
71  sizer->Add( _sampling, 1, wxGROW );
72  sizer->Add( segmentationOneSliceBtn, 1, wxGROW );
73  sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW );
74  sizer->Add( _staticTextSegmentation, 1, wxGROW );
75  sizer->Add( segmentationAllSliceBtn, 1, wxGROW );
76  sizer->Add( _mbarrange, 1, wxGROW );
77 
78  this->SetSizer( sizer );
79 // panel->SetSize( sizePanel );
80  this->SetSize( wxDefaultSize );
81  this->SetAutoLayout( true );
82  this->Layout();
83 
84 //_segmentationFrame->SetEventHandler( this );
85  //segmentationOneSliceBtn->SetEventHandler( this );
86  //segmentationAllSliceBtn->SetEventHandler( this );
87  //panel->SetEventHandler(this);
88  Connect( segmentationOneSliceBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) &interfSegmentationPanelVTK::onSegmentationOneSlice);
89  Connect( segmentationAllSliceBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) &interfSegmentationPanelVTK::onSegmentationAllSlice);
90 }

Here is the call graph for this function:

interfSegmentationPanelVTK::~interfSegmentationPanelVTK ( )

Definition at line 93 of file interfSegmentationPanels.cxx.

94 {
95 }

Member Function Documentation

wxPanel* interfSegmentationPanelVTK::getSegmentationPanel ( wxWindow *  parent)
private
void interfSegmentationPanelVTK::hideAxis ( )
private
void interfSegmentationPanelVTK::onSegmentationAllSlice ( wxCommandEvent &  event)
private

Definition at line 134 of file interfSegmentationPanels.cxx.

References _isovalue, _mbarrange, _sampling, interfMainPanel::getInstance(), methodRadiobox, and interfMainPanel::onSegmentationAllSlice().

Referenced by interfSegmentationPanelVTK().

135 {
136  int minZ=_mbarrange->GetStart();
137  int maxZ=_mbarrange->GetEnd();
138 
139  int isovalue = _isovalue->GetValue();
140  int sampling = _sampling->GetValue();
141  int method = methodRadiobox->GetSelection();
142 
143  interfMainPanel::getInstance()->onSegmentationAllSlice(minZ, maxZ, isovalue, sampling, method);
144 }

Here is the call graph for this function:

Here is the caller graph for this function:

void interfSegmentationPanelVTK::onSegmentationOneSlice ( wxCommandEvent &  event)
private

Definition at line 126 of file interfSegmentationPanels.cxx.

References _isovalue, _sampling, interfMainPanel::getInstance(), methodRadiobox, and interfMainPanel::onSegmentationOneSlice().

Referenced by interfSegmentationPanelVTK().

127 {
128  int isovalue = _isovalue->GetValue();
129  int sampling = _sampling->GetValue();
130  int method = methodRadiobox->GetSelection();
131  interfMainPanel::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
132 
133 }

Here is the call graph for this function:

Here is the caller graph for this function:

void interfSegmentationPanelVTK::onSegmentationPressed ( wxCommandEvent &  event)

Responds to the events of the buttons, when the same panel is responsible for it. It gets the name of the button corresponding to the method that has to be executed, it uses attribute eventHandler to call the methods define by the application. see setEventHandler(wxEventHandler*)

void interfSegmentationPanelVTK::onSegmentationPressedITK ( wxCommandEvent &  event)

Responds to the events of the buttons, when the same panel is responsible for it. It gets the name of the button corresponding to the method that has to be executed, it uses attribute eventHandler to call the methods define by the application. see setEventHandler(wxEventHandler*)

Definition at line 104 of file interfSegmentationPanels.cxx.

References interfMainPanel::getInstance(), segmentPanelITK, and interfMainPanel::showPanel().

104  {
105  if(segmentPanelITK == NULL) {
106  segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
107 
108  wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
109  segmentPanelITK->SetSizer(flexsizer, true);
110  segmentPanelITK->SetAutoLayout( true );
111 
112  wxPanel* panel = new wxPanel(this, -1);//contourevent->getSegmentationPanelITK(segmentPanelITK);
113 
114  wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T(" Automatic ITK Segmentation ")), wxDefaultPosition,
115  wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
116 
117  flexsizer->Add(stattext, wxALIGN_CENTER | wxALIGN_CENTRE);
118  flexsizer->Add(panel, wxEXPAND);
119  segmentPanelITK->Layout();
120  }
122  //contourevent->showAxis(true);
123  //axisshown = true;
124 }

Here is the call graph for this function:

void interfSegmentationPanelVTK::setLabel ( wxString  tmpString)

Definition at line 146 of file interfSegmentationPanels.cxx.

References _staticTextSegmentation.

146  {
147  _staticTextSegmentation->SetLabel(tmpString);
148 }

Member Data Documentation

wxSlider* interfSegmentationPanelVTK::_isovalue
private
mBarRange* interfSegmentationPanelVTK::_mbarrange
private
wxSlider* interfSegmentationPanelVTK::_sampling
private
wxStaticText* interfSegmentationPanelVTK::_staticTextSegmentation
private

Definition at line 77 of file interfSegmentationPanels.h.

Referenced by interfSegmentationPanelVTK(), and setLabel().

bool interfSegmentationPanelVTK::axisshown
private

Definition at line 61 of file interfSegmentationPanels.h.

wxPanel* interfSegmentationPanelVTK::configPanel
private

Definition at line 56 of file interfSegmentationPanels.h.

wxWindow* interfSegmentationPanelVTK::infoWin
private

Definition at line 57 of file interfSegmentationPanels.h.

wxRadioBox* interfSegmentationPanelVTK::methodRadiobox
private
wxPanel* interfSegmentationPanelVTK::segmentPanel
private

Definition at line 58 of file interfSegmentationPanels.h.

wxPanel* interfSegmentationPanelVTK::segmentPanelITK
private

Definition at line 60 of file interfSegmentationPanels.h.

Referenced by onSegmentationPressedITK().

wxPanel* interfSegmentationPanelVTK::spreadPanel
private

Definition at line 59 of file interfSegmentationPanels.h.


The documentation for this class was generated from the following files: