mirrorPanel = NULL;
thresholdPanel = NULL;
currentWindow = NULL;
-
+
+//CMRU 17-08-09 ------------------------------------------------------------------
+ infoPanelCalibration = NULL;
+ panelAux = NULL;
+//--------------------------------------------------------------------------------
splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
splitterwindow->SetMinimumPaneSize( 10 );
wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2);
infoPanel->SetSizer(infosizer, true);
infoPanel->SetAutoLayout( true );
-
+
splitterwindow->Initialize(toolpanel);
splitterwindow->SetSashGravity(1);
splitterwindow->SplitHorizontally(toolpanel, infoPanel);
-
+
Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourLine();
}
+
+// RaC 09-09 ---------------------
+void interfMainPanel::onCreateContourPoints( ){
+ wxContourMainFrame::getInstance()->showAxis(false);
+ wxContourMainFrame::getInstance()->onCreateContourPoints();
+}
+// RaC 09-09 ---------------------
+
void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull){
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
//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("")));
//contourevent->FillGridWithContoursInformation();
infoWin->Show(true);
}
+ }
+
+//CMRU 29-08-09-----------------------------------------------------------------------------------------------
+ if(panelAux == NULL)
+ {
+ panelAux = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
}
-
+//------------------------------------------------------------------------------------------------------------
+
// mask view control panel
if(infoPanelMask == NULL){
- infoPanelMask = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
+ infoPanelMask = new wxPanel(panelAux, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
infoPanelMask->SetSizer(flexsizer, true);
infoPanelMask->SetAutoLayout( true );
infoPanelMask->Layout();
}
- showPanel(infoPanelMask);
+
+//CMRU 29-08-09-----------------------------------------------------------------------------------------------
+ //Calibration panel
+ if(infoPanelCalibration == NULL)
+ {
+ infoPanelCalibration = new wxPanel(panelAux, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER , wxString(_T("")));
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+ infoPanelCalibration->SetSizer(flexsizer, true);
+ infoPanelCalibration->SetAutoLayout( true );
+
+ wxPanel *panel = new interfCalibrationPanel(infoPanelCalibration);
+ wxStaticText* stattext = new wxStaticText(infoPanelCalibration, -1, wxString(_T(" Calibration ")), wxDefaultPosition,
+ wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+
+ flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+
+ flexsizer->Add(panel, wxEXPAND);
+ infoPanelCalibration->Layout();
+ }
+
+ wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
+ panelAux->SetSizer(sizer, true);
+ panelAux->SetAutoLayout( true );
+ sizer->Add(infoPanelMask);
+ sizer->Add(infoPanelCalibration);
+
+ showPanel(panelAux);
+
+//------------------------------------------------------------------
+
wxContourMainFrame::getInstance()->changeInstant();
}
{
wxContourMainFrame::getInstance()->SetContourGroup( contourGroup);
}
+
+//CMRU 17-08-09 ---------------------------------------------
+void interfMainPanel::onPrintLabel ()
+{
+ wxString label;
+ manualBaseModel* manualModel = wxContourMainFrame::getInstance()->getContour();
+
+ if(manualModel==NULL)
+ {
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please select a Contour"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
+ dial->ShowModal();
+ return;
+ }
+
+ wxTextEntryDialog* dialog = new wxTextEntryDialog(this,"Enter a tag name: ") ;
+
+ if (dialog->ShowModal() == wxID_OK)
+ {
+ label = dialog->GetValue();
+
+ if(label.Len()!=0)
+ {
+ wxContourMainFrame::getInstance()->onPrintLabel(label,manualModel);
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("The tag name was updated"), wxT("Information"), wxOK | wxICON_INFORMATION);
+ dial->ShowModal();
+ }
+ else
+ {
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please enter a valid tag"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
+ dial->ShowModal();
+ }
+ }
+}
+void interfMainPanel::onCalibration(wxString size, int unit)
+{
+ int type = 0;
+ double contourSize = 0.0;
+ double realSizeDouble = 0.0;
+
+ type = wxContourMainFrame::getInstance()->getType();
+ contourSize = wxContourMainFrame::getInstance()->getContourSizeInPixels();
+
+ std::cout<<"Cata->TamaƱo del contorno en pixeles:"<<contourSize<<endl;
+
+ if ( type == 6 )
+ {
+ if (size.ToDouble(&realSizeDouble))
+ {
+ if(unit==1)
+ {
+ realSizeDouble = realSizeDouble * 10;
+ }
+ if(unit==2)
+ {
+ realSizeDouble = realSizeDouble * 25.4;
+ }
+ std::cout<< "Valor del usuario" << realSizeDouble<< endl ;
+ onePixelSize (realSizeDouble,contourSize);
+ }
+ else
+ {
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please enter a numeric value"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
+ dial->ShowModal();
+ }
+ }
+ else
+ {
+
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please select a line contour"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
+ dial->ShowModal();
+ }
+
+ wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("The calibration was made"), wxT("Information"), wxOK | wxICON_INFORMATION);
+ dial->ShowModal();
+ std::cout<< "Cata-> Se ha realizado la calibracion" << endl ;
+}
+
+double interfMainPanel::onePixelSize (double realSize,double sizePixel)
+{
+ _pixelValue = realSize/sizePixel;
+ std::cout<< "Valor del un pixel = " << _pixelValue<< endl ;
+ wxContourMainFrame::getInstance()->onePixelSize (_pixelValue);
+ return _pixelValue ;
+}
+double interfMainPanel::GetPixelValue()
+{
+ return _pixelValue;
+}
+//------------------------------------------------------------------------------------------------------------
\ No newline at end of file