+
+void interfMainPanel::onCreateContourSpline( ){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onCreateContourSpline();
+}
+void interfMainPanel::onCreateContourRectangle( ){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onCreateContourRectangle();
+}
+void interfMainPanel::onCreateContourCircle( ){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onCreateContourCircle();
+}
+void interfMainPanel::onCreateContourLine( ){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onCreateContourLine();
+}
+void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
+}
+void interfMainPanel::onDeleteContour(){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onDeleteContour();
+}
+void interfMainPanel::onDeleteContoursActSlice(){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
+}
+void interfMainPanel::onDeleteAllContours(){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onDeleteAllContours();
+}
+
+void interfMainPanel::onCopy(){
+ wxContourMainFrame::getInstance()->onCopy();
+}
+void interfMainPanel::onPaste(){
+ wxContourMainFrame::getInstance()->onPaste();
+}
+void interfMainPanel::onUndo(){
+ wxContourMainFrame::getInstance()->onUndo();
+}
+void interfMainPanel::onRedo(){
+ wxContourMainFrame::getInstance()->onRedo();
+}
+void interfMainPanel::onLoad(){
+ wxContourMainFrame::getInstance()->onLoad();
+}
+void interfMainPanel::onSave(){
+ wxContourMainFrame::getInstance()-> onSave();
+}
+void interfMainPanel::RefreshInterface(){
+ wxContourMainFrame::getInstance()->RefreshInterface();
+}
+
+vtkImageData* interfMainPanel::getImageData(){
+ return wxContourMainFrame::getInstance()->getImageData();
+}
+
+void interfMainPanel::getImageRange(double range[2] )
+{
+ vtkImageData * img = getImageData();
+ img->GetScalarRange(range);
+}
+
+void interfMainPanel::onSegmentationOneSlice(int isovalue,int sampling,int method)
+{
+ wxContourMainFrame::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
+}
+
+void interfMainPanel::onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation){
+ wxContourMainFrame::getInstance()->onSegmentationOneSliceITK(distance, sigma, alfa, beta, propagation, iterations, inflation);
+}
+
+int interfMainPanel::GetImageDataSizeZ(){
+ return wxContourMainFrame::getInstance()->GetImageDataSizeZ();
+}
+
+void interfMainPanel::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method){
+ wxContourMainFrame::getInstance()->onSegmentationAllSlice(minZ, maxZ,isovalue,sampling,method);
+}
+
+void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString){
+ ((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
+}
+void interfMainPanel::onSegmentationPressed(){
+ if(segmentPanel == NULL){
+ segmentPanel = new wxPanel(getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ segmentPanel->SetSizer(flexsizer, true);
+ segmentPanel->SetAutoLayout( true );
+ segmentPanel->SetEventHandler(this);
+
+ //wxPanel* panel = contourevent->getSegmentationPanel(segmentPanel);
+ segmentationPanel = new interfSegmentationPanelVTK(segmentPanel);
+
+
+ wxStaticText* stattext = new wxStaticText(segmentPanel, -1, wxString(_T(" Automatic Segmentation ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+ flexsizer->Add(segmentationPanel, wxEXPAND);
+ segmentPanel->Layout();
+ }
+ showPanel(segmentPanel);
+ wxContourMainFrame::getInstance()->showAxis(true);
+ axisshown = true;
+}
+
+void interfMainPanel::onSegmentationPressedITK(){
+ if(segmentPanelITK == NULL){
+ segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+
+
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ segmentPanelITK->SetSizer(flexsizer, true);
+ segmentPanelITK->SetAutoLayout( true );
+ //segmentPanelITK->SetEventHandler(this->contourevent);
+
+ //wxPanel* panel = contourevent->getSegmentationPanelITK(segmentPanelITK);
+ wxPanel* panel = new interfSegmentationPanelITK(segmentPanelITK);
+
+
+ wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T(" Automatic ITK Segmentation ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+ flexsizer->Add(panel, wxEXPAND);
+ segmentPanelITK->Layout();
+ }
+ showPanel(segmentPanelITK);
+ wxContourMainFrame::getInstance()->showAxis(true);
+ axisshown = true;
+}
+
+void interfMainPanel::onRigidPressed(){
+ wxContourMainFrame::getInstance()->onRigidPressed();
+}
+
+void interfMainPanel::onWidthOfContour(double width){
+ wxContourMainFrame::getInstance()->onWidthOfContour(width);
+}
+
+int interfMainPanel::getColorWindow(){
+ return wxContourMainFrame::getInstance()->getColorWindow();
+}
+int interfMainPanel::getWindowLevel(){
+ return wxContourMainFrame::getInstance()->getWindowLevel();
+}
+void interfMainPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
+ wxContourMainFrame::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
+}
+
+void interfMainPanel::onInterpolation(bool interpolate)
+{
+ wxContourMainFrame::getInstance()->onInterpolation(interpolate);
+}
+
+void interfMainPanel::onConfigurationPressed(){
+
+ if(configPanel == NULL){
+ configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ configPanel->SetSizer(flexsizer, true);
+ configPanel->SetAutoLayout( true );
+ //configPanel->SetEventHandler(this->contourevent);
+
+ wxPanel* panel = new interfConfigurationPanel(configPanel);
+
+ wxStaticText* stattext = new wxStaticText(configPanel, -1, wxString(_T(" Interface Configuration ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+
+ flexsizer->Add(panel, wxEXPAND);
+ configPanel->Layout();
+
+ }
+ showPanel(configPanel);
+}
+
+void interfMainPanel::onSpreadPressed(){
+ if(spreadPanel==NULL){
+
+ spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ spreadPanel->SetSizer(flexsizer, true);
+ spreadPanel->SetAutoLayout( true );
+ //spreadPanel->SetEventHandler(this->contourevent);
+
+ //wxPanel* panel = contourevent->getSpreadPanel(spreadPanel);
+ panelSpread = new interfSpreadPanel(spreadPanel);
+
+
+ wxStaticText* stattext = new wxStaticText(spreadPanel, -1, wxString(_T(" Automatic Spread ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+ flexsizer->Add(panelSpread, wxEXPAND);
+ spreadPanel->Layout();
+ }
+ showPanel(spreadPanel);
+ //hideAxis();
+}
+
+void interfMainPanel::resetAppend(){
+ wxContourMainFrame::getInstance()->resetAppend();
+}
+
+void interfMainPanel::onSpreadAdd(){
+ wxContourMainFrame::getInstance()->onSpreadAdd();
+}
+
+void interfMainPanel::appendStringSpread(std::string val){
+ panelSpread->appendStringSpread(val);
+}
+
+void interfMainPanel::onSpreadGo(int type){
+ wxContourMainFrame::getInstance()->onSpreadGo(type);
+}
+void interfMainPanel::setStringSpread(std::string stringtemp){
+ panelSpread->setStringSpread(stringtemp);
+}
+
+void interfMainPanel::onInformationPressed(){
+ if(infoWin ==NULL){
+ infoWin = new wxFrame (this, -1,_T(" Statistics "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
+ infoWin->SetSize( wxSize(825,650) );
+
+ wxSize sizepanel(825,675);
+ informationPanel = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
+
+ wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
+ sizerPanel -> Add( informationPanel , 1, wxEXPAND ,0);
+
+ infoWin->SetSizer( sizerPanel );
+ infoWin->SetAutoLayout( true );
+ infoWin->Layout();
+
+ infoWin->Show();
+
+ }else {
+
+ if (infoWin->IsShown()==true)
+ {
+ infoWin->Show(false);
+ } else {
+ //contourevent->FillGridWithContoursInformation();
+ infoWin->Show(true);
+ }
+ }
+}
+
+void interfMainPanel::getInstantVector(std::vector<int>& tempVector){
+ wxContourMainFrame::getInstance()->getInstantVector(tempVector);
+}
+
+std::vector<std::string> interfMainPanel::getOutlinesName(int slide){
+ return wxContourMainFrame::getInstance()->getOutlinesName(slide);
+}
+
+void interfMainPanel::onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ){
+ wxContourMainFrame::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ);
+}
+
+void interfMainPanel::setStringInfoPanel(wxString tmpString){
+ if(informationPanel!=NULL){
+ ((interfInformationPanel*)informationPanel)->setStringInfoPanel(tmpString);
+ }
+}
+
+void interfMainPanel::setRowLabelInfoPanel(int z, wxString tempString){
+ ((interfInformationPanel*)informationPanel)->setRowLabelInfoPanel(z, tempString);
+}
+
+int interfMainPanel::getNumberColsInformationPanel(){
+ return ((interfInformationPanel*)informationPanel)->getNumberCols();
+}
+
+void interfMainPanel::appendColsInformationPanel(int _numberOfVariablesStatistics){
+ ((interfInformationPanel*)informationPanel)->appendCols(_numberOfVariablesStatistics);
+}
+
+void interfMainPanel::setCellValueInfoPanel(int z,int tmpIntA,wxString tempString){
+ ((interfInformationPanel*)informationPanel)->setCellValue(z, tmpIntA, tempString);
+}
+
+void interfMainPanel::setColLableInfoPanel(int tmpIntB,wxString tmpTitleString){
+ ((interfInformationPanel*)informationPanel)->setColLabel(tmpIntB, tmpTitleString);
+
+}
+
+void interfMainPanel::onSaveResults(std::string directory,std::string namefile, std::string filename,
+ int typeContourGroup, bool XYZValues, bool contourImage, bool statistics)
+{
+ wxContourMainFrame::getInstance()->onSaveResults(directory, namefile, filename,
+ typeContourGroup, XYZValues, contourImage, statistics);
+}
+
+wxString interfMainPanel::getCellValue(int j,int i){
+ return ((interfInformationPanel*)informationPanel)->getCellValue(j, i );
+}
+
+void interfMainPanel::onSnakePressed()
+{
+ axisshown=false;
+ wxContourMainFrame::getInstance()->showAxis(axisshown);
+ wxContourMainFrame::getInstance()->onSnakePressed();
+}
+
+void interfMainPanel::onMirrorPressed(){
+ if(mirrorPanel==NULL)
+ {
+
+ mirrorPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ mirrorPanel->SetSizer(flexsizer, true);
+ mirrorPanel->SetAutoLayout( true );
+ panelMirror = new interfMirrorPanel(mirrorPanel);
+
+ wxStaticText* stattext = new wxStaticText(mirrorPanel, -1, wxString(_T(" Mirroring Tool ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+ flexsizer->Add(panelMirror, wxEXPAND);
+ mirrorPanel->Layout();
+
+ refLineShown=true;
+ wxContourMainFrame::getInstance()->referenceLine();
+ }
+
+ else
+ {
+
+ if (!refLineShown)
+ {
+ wxContourMainFrame::getInstance()->refLineShow();
+ refLineShown=true;
+ }
+ }
+
+ showPanel(mirrorPanel);
+}
+
+void interfMainPanel::onMirror()
+{
+ wxContourMainFrame::getInstance()->onMirror();
+}
+
+void interfMainPanel::onMirrorAxisShow()
+{
+ if (!refLineShown)
+ {
+ wxContourMainFrame::getInstance()->refLineShow();
+ refLineShown=true;
+ }
+}
+
+void interfMainPanel::onMirrorAxisHide()
+{
+ if (refLineShown)
+ {
+ wxContourMainFrame::getInstance()->refLineHide();
+ refLineShown=false;
+ }
+}
+
+void interfMainPanel::onMirrorChangeWidth(int width)
+{
+ wxContourMainFrame::getInstance()->refLineChangeWidth(width);
+}
+
+
+void interfMainPanel::onThreshold()
+{
+ wxContourMainFrame::getInstance()->onThreshold();
+}
+
+void interfMainPanel::onThresholdChange()
+{
+ wxContourMainFrame::getInstance()->onThresholdChange();
+}
+
+void interfMainPanel::onThresholdInstantChange(double range[])
+{
+ panelThreshold->onThresholdInstantChange(range);
+}
+
+void interfMainPanel::onThresholdInterpolation(bool interpolate)
+{
+ wxContourMainFrame::getInstance()->onThresholdInterpolation(interpolate);
+}
+
+void interfMainPanel::onThresholdChangeOpacity (int opacity)
+{
+ wxContourMainFrame::getInstance()->onThresholdChangeOpacity(opacity);
+}
+
+void interfMainPanel::onThresholdRemove()
+{
+ wxContourMainFrame::getInstance()->onThresholdRemove();
+}
+
+void interfMainPanel::onThresholdPressed()
+{
+ if(thresholdPanel==NULL)
+ {
+
+ thresholdPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ thresholdPanel->SetSizer(flexsizer, true);
+ thresholdPanel->SetAutoLayout( true );
+ panelThreshold = new interfThresholdPanel(thresholdPanel);
+
+ wxStaticText* stattext = new wxStaticText(thresholdPanel, -1, wxString(_T(" Threshold Tool ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+ flexsizer->Add(panelThreshold, wxEXPAND);
+ thresholdPanel->Layout();
+
+ }
+ showPanel(thresholdPanel);
+}
+
+void interfMainPanel::ShowResultImages(int typeContourGroup)
+{
+ wxContourMainFrame::getInstance()->ShowResultImages(typeContourGroup);
+}
+
+