initButtons(this);
}
-void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler) {
-
+void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler)
+{
+printf("EED interfImageToolsMenu::initButtons start\n");
std::vector<std::string> path, nom;
std::vector<wxObjectEventFunction> funct;
nom.push_back("Show help page with information about the tools");
funct.push_back((wxObjectEventFunction) &interfImageToolsMenu:: onHelpPressed);
-
this->addButtons(path, nom);
this->setVectorFunction(funct);
-
this->connectEvents(evtHandler);
-
-
+printf("EED interfImageToolsMenu::initButtons End\n");
}
interfImageToolsMenu::~interfImageToolsMenu()
void interfImageToolsMenu::onInformationPressed(wxCommandEvent& event)
{
+printf("EED interfImageToolsMenu::onInformationPressed start\n");
interfMainPanel::getInstance()->onInformationPressed();
+printf("EED interfImageToolsMenu::onInformationPressed end\n");
}
void interfImageToolsMenu::onConfigurationPressed(wxCommandEvent& event)
void interfImageToolsMenu::onHelpPressed(wxCommandEvent& event)
{
- wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/site/fr/EndUserGuide"), 0);
+ wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/site7/fr/EndUserGuide"), 0);
}
//------------------------------------------------------------------------------------------------------------
panelAux = NULL;
//--------------------------------------------------------------------------------
splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
-
splitterwindow->SetMinimumPaneSize( 10 );
sizey = sizey/8;
-
wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T("")));
-
-//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
-#if wxMAJOR_VERSION <= 2
- wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1);
-#else
- wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6);
-#endif
+ wxFlexGridSizer* flexsizer = new wxFlexGridSizer(20,2,1,1);
toolpanel->SetSizer(flexsizer, true);
toolpanel->SetAutoLayout( true );
-
wxButton* b = getButton(toolpanel);
b->SetClientData(&PANEL);
wxButton* b1 = getButton(toolpanel);
//EED 07/07/2010
wxButton* b6 = getButton(toolpanel);
b6->SetClientData(&PANEL6);
-
wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
wxPanel* mentex5 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
//EED 07/07/2010
wxPanel* mentex6 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
-
menubar = new interfNewContourMenu (mentex, sizex, sizey, evtHandler, datadir);
menubar1 = new interfIOMenu (mentex1, sizex, sizey, evtHandler, datadir);
menubar2 = new interfEditMenu (mentex2, sizex, sizey, evtHandler, datadir);
menubar4 = new interfToolsMenu (mentex4, sizex ,sizey, evtHandler, datadir);
menubar5 = new interfSegmentationMenu(mentex5, sizex, sizey, evtHandler, datadir);
menubar6 = new interfImageToolsMenu(mentex6, sizex, sizey, evtHandler, datadir);
-
statictext = getText(mentex, PANEL);
statictext1 = getText(mentex1, PANEL1);
statictext2 = getText(mentex2, PANEL2);
statictext4 = getText(mentex4, PANEL4);
statictext5 = getText(mentex5, PANEL5);
statictext6 = getText(mentex6, PANEL6);
-
flexsizer->Add(b, wxFIXED_MINSIZE);
flexsizer->Add(setMenuTextSizer(mentex, menubar,statictext), wxFIXED_MINSIZE);
-
flexsizer->Add(b1, wxFIXED_MINSIZE);
flexsizer->Add(setMenuTextSizer(mentex1, menubar1,statictext1), wxFIXED_MINSIZE);
-
flexsizer->Add(b2, wxFIXED_MINSIZE);
flexsizer->Add(setMenuTextSizer(mentex2, menubar2,statictext2), wxFIXED_MINSIZE);
-
flexsizer->Add(b3, wxFIXED_MINSIZE);
flexsizer->Add(setMenuTextSizer(mentex3, menubar3,statictext3), wxFIXED_MINSIZE);
-
flexsizer->Add(b4, wxFIXED_MINSIZE);
flexsizer->Add(setMenuTextSizer(mentex4, menubar4,statictext4), wxFIXED_MINSIZE);
-
flexsizer->Add(b5, wxFIXED_MINSIZE);
flexsizer->Add(setMenuTextSizer(mentex5, menubar5,statictext5), wxFIXED_MINSIZE);
flexsizer->Add(b6, wxFIXED_MINSIZE);
flexsizer->Add(setMenuTextSizer(mentex6, menubar6,statictext6), wxFIXED_MINSIZE);
-
toolpanel->Update();
toolpanel->Layout();
-
infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T("")));
wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2);
infoPanel->SetSizer(infosizer, true);
infoPanel->SetAutoLayout( true );
-
splitterwindow->Initialize(toolpanel);
splitterwindow->SetSashGravity(1);
//EED splitterwindow->SetSashPosition(600);
splitterwindow->SetSashSize(5);
splitterwindow->SplitHorizontally(toolpanel, infoPanel,8*73);
-
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);
Connect(b4->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
Connect(b5->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
Connect(b6->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
-
this->Layout();
}
interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler)
{
_newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT);
-
- if(interfmainpanel == NULL){
+ if(interfmainpanel == NULL)
+ {
interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler, datadir);
}
_newframe->Show(TRUE);
interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler)
{
-
_newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT );
-
- if(interfmainpanel == NULL){
+ if(interfmainpanel == NULL)
+ {
interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler);
}
_newframe->Show(TRUE);
wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler)
{
wxPanel* panel = new wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN, wxString(_T("Spread")));
-
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2) ;
panel->SetSizer(flexsizer, true);
panel->SetAutoLayout( true );
-
- interfToolsMenu* menu = new interfToolsMenu(panel, sizex, sizey, evtHandler);
- toolspread = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
-
+ interfToolsMenu *menu = new interfToolsMenu(panel, sizex, sizey, evtHandler);
+ toolspread = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
flexsizer->Add(menu, wxFIXED_MINSIZE);
flexsizer->Add(toolspread, wxFIXED_MINSIZE);
-
panel->Layout();
-
return panel;
}
wxPanel* interfMainPanel::setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text)
{
-
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2);
parent->SetSizer(flexsizer, true);
parent->SetAutoLayout( true );
-
flexsizer->Add(text, wxFLEX_GROWMODE_ALL);
flexsizer->Add(panel, wxFLEX_GROWMODE_ALL);
-
parent->Layout();
return (wxPanel*)parent;
}
{
wxContourMainFrame::getInstance()->showAxis(false);
wxSizer* sizer = infoPanel->GetSizer();
-
- if(currentWindow != NULL){
+ if(currentWindow != NULL)
+ {
currentWindow->Hide();
/// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#else
sizer->Detach(currentWindow);
#endif
-
- }
+ } // if currentWindow
sizer->Add(panel);
currentWindow = panel;
currentWindow->Show(true);
-
splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
-
infoPanel->Layout();
infoPanel->Refresh();
this->Layout();
{
wxContourMainFrame::getInstance()->showAxis(false);
wxSizer* sizer = infoPanel->GetSizer();
-
- if(currentWindow != NULL){
+ if(currentWindow != NULL)
+ {
currentWindow->Hide();
/// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
sizer->Add(emptyPanel);
currentWindow = emptyPanel;
currentWindow->Show(true);
-
splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
-
infoPanel->Layout();
infoPanel->Refresh();
this->Layout();
{
((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
}
+
void interfMainPanel::onSegmentationPressed()
{
- if(segmentPanel == NULL){
+ 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();
- }
+ }// if segmentPanel
showPanel(segmentPanel);
wxContourMainFrame::getInstance()->showAxis(true);
axisshown = true;
void interfMainPanel::onSegmentationPressedITK()
{
- if(segmentPanelITK == NULL){
+ 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 );
flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
flexsizer->Add(panel, wxEXPAND);
segmentPanelITK->Layout();
- }
+ }// if segmentPanelITK
showPanel(segmentPanelITK);
wxContourMainFrame::getInstance()->showAxis(true);
axisshown = true;
void interfMainPanel::onConfigurationPressed()
{
- if(configPanel == NULL){
+ 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);
flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
flexsizer->Add(panel, wxEXPAND);
configPanel->Layout();
- }
+ }// if configPanel
showPanel(configPanel);
}
void interfMainPanel::onSpreadPressed()
{
- if(spreadPanel==NULL){
-
+ 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();
- }
+ } // spreadPanel
showPanel(spreadPanel);
//hideAxis();
}
void interfMainPanel::onInformationPressed()
{
-
+printf("EED interfMainPanel::onInformationPressed Start\n");
// Statistics frame
- if(infoWin ==NULL){
+ if(infoWin ==NULL)
+ {
+printf("EED interfMainPanel::onInformationPressed 0.1\n");
infoWin = new wxFrame (this, -1,_T(" Statistics "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
+printf("EED interfMainPanel::onInformationPressed 0.2\n");
infoWin->SetSize( wxSize(825,650) );
wxSize sizepanel(825,675);
+printf("EED interfMainPanel::onInformationPressed 0.3\n");
informationPanel = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
+printf("EED interfMainPanel::onInformationPressed 0.3a\n");
wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
sizerPanel -> Add( informationPanel, 1, wxEXPAND ,0);
+printf("EED interfMainPanel::onInformationPressed 0.4\n");
infoWin->SetSizer( sizerPanel );
+printf("EED interfMainPanel::onInformationPressed 0.41\n");
infoWin->SetAutoLayout( true );
+printf("EED interfMainPanel::onInformationPressed 0.42\n");
infoWin->Layout();
+printf("EED interfMainPanel::onInformationPressed 0.43\n");
infoWin->Show();
}else {
+printf("EED interfMainPanel::onInformationPressed 0.5\n");
if (infoWin->IsShown()==true)
{
+printf("EED interfMainPanel::onInformationPressed 0.6\n");
infoWin->Show(false);
} else {
//contourevent->FillGridWithContoursInformation();
+printf("EED interfMainPanel::onInformationPressed 0.7\n");
infoWin->Show(true);
}
}
+printf("EED interfMainPanel::onInformationPressed 1\n");
+
//CMRU 29-08-09-----------------------------------------------------------------------------------------------
if(panelAux == NULL)
{
panelAux = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
}
//------------------------------------------------------------------------------------------------------------
+printf("EED interfMainPanel::onInformationPressed 2\n");
// mask view control panel
if(infoPanelMask == NULL){
}
+printf("EED interfMainPanel::onInformationPressed 3\n");
//CMRU 29-08-09-----------------------------------------------------------------------------------------------
//Calibration panel
if(infoPanelCalibration == NULL)
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(panel, wxEXPAND);
infoPanelCalibration->Layout();
}
+printf("EED interfMainPanel::onInformationPressed 4\n");
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
- panelAux->SetSizer(sizer, true);
- panelAux->SetAutoLayout( true );
+#else
+ wxFlexGridSizer* sizer = new wxFlexGridSizer(2);
+#endif
sizer->Add(infoPanelMask);
+printf("EED interfMainPanel::onInformationPressed 4.1\n");
sizer->Add(infoPanelCalibration);
-
+printf("EED interfMainPanel::onInformationPressed 4.2\n");
+ panelAux->SetSizer(sizer, true);
+printf("EED interfMainPanel::onInformationPressed 4.3\n");
+ panelAux->SetAutoLayout( true );
+printf("EED interfMainPanel::onInformationPressed 4.4\n");
showPanel(panelAux);
+printf("EED interfMainPanel::onInformationPressed 4.5\n");
//------------------------------------------------------------------
-
+printf("EED interfMainPanel::onInformationPressed OOJJOOOOOOOOOO......\n");
wxContourMainFrame::getInstance()->changeInstant();
+printf("EED interfMainPanel::onInformationPressed End\n");
}
+
void interfMainPanel::getInstantVector(std::vector<int>& tempVector)
{
wxContourMainFrame::getInstance()->getInstantVector(tempVector);
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
- {
-
+ } else {
if (!refLineShown)
{
wxContourMainFrame::getInstance()->refLineShow();
refLineShown=true;
}
- }
+ } // if mirrorPanel
showPanel(mirrorPanel);
}
//RaC 11-09
//This constructor function as well but it is neccessary to change vpath.size() by 6
//flexsizer = new wxFlexGridSizer(2,vpath.size(),2,2);
- flexsizer = new wxFlexGridSizer(6);
+ flexsizer = new wxFlexGridSizer(5);
this->SetSizer(flexsizer, true);
this->SetAutoLayout( true );
-
//first row of the sizer, the buttons are being added
- for(int i = 0; i < (int)(vpath.size());i++){
+ for(int i = 0; i < (int)(vpath.size());i++)
+ {
std::string p = vpath[i];
wxBitmapButton* bitmapbutton = this->getButton(p, sizex, sizey);
flexsizer->Add(bitmapbutton,wxFIXED_MINSIZE);
}
//second row of the sizer, the names are being added
- for(int i = 0; i < (int)(vnom.size()); i++){
+ for(int i = 0; i < (int)(vnom.size()); i++)
+ {
//sizex = vectbutton[i]->GetSize().GetWidth();
std::string n = vnom[i];
vectbutton[i]->SetToolTip(wxString(n.c_str(),wxConvUTF8));
** @param int y indicates the y coordinate where the button should be located
**/
- virtual wxBitmapButton* getButton(std::string imgpath, int sizex, int sizey){
- vectimgpath.push_back(imgpath);
-
-
+ virtual wxBitmapButton* getButton(std::string imgpath, int sizex, int sizey)
+ {
+ vectimgpath.push_back(imgpath);
wxBitmap* bitmap = new wxBitmap(wxString(imgpath.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
//wxSize(sizex,sizey)
** @param int sizex size of the text
** @param int sizey size of the text
**/
- virtual wxStaticText* getText(std::string nom, int sizex, int sizey){
+ virtual wxStaticText* getText(std::string nom, int sizex, int sizey)
+ {
vectnom.push_back(nom);
return new wxStaticText(this, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition,
wxSize(sizex,sizey), wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
** they must be ordered in the same way as the vector that contains the image path
** and name of the button. See addButton(<vect>, <vect>)
**/
- virtual void setVectorFunction(std::vector<wxObjectEventFunction> vectf){
- for(int i = 0; i < (int)(vectf.size());i++){
+ virtual void setVectorFunction(std::vector<wxObjectEventFunction> vectf)
+ {
+ for(int i = 0; i < (int)(vectf.size());i++)
+ {
vectfunct.push_back(vectf[i]);
}
}
{
this->datadir = datdir;
//eventHandler = (wxContourEventHandler*)evtHandler;
-
panBull = NULL;
created = false;
-
initButtons(this);
}
-void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler) {
-
+void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler)
+{
std::vector<std::string> path, nom;
std::vector<wxObjectEventFunction> funct;
- std::vector<wxEvtHandler*> hand;
-
+ std::vector<wxEvtHandler*> hand;
path.push_back(datadir + "/Spline.png");
nom.push_back("Create a contour using splines");
funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourSpline);
hand.push_back(evtHandler);
-
path.push_back(datadir+"/Rectangle.png");
nom.push_back("Create a contour using the basic shape of a rectangle");
funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourRectangle);
hand.push_back(evtHandler);
-
path.push_back(datadir + "/Circle.png");
nom.push_back("Create a contour using the basic shape of a Circle");
funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourCircle);
hand.push_back(evtHandler);
-
path.push_back(datadir + "/bullseye.png");
nom.push_back("Create a contour using the bulls eye");
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourBullseye);
hand.push_back(this);
-
path.push_back(datadir + "/Line.png");
nom.push_back("Create a Line");
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
hand.push_back(this);
-
// RaC 09-09 ---------------------
path.push_back(datadir + "/Points.png");
nom.push_back("Create Points");
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPoints);
hand.push_back(this);
// RaC 09-09 ---------------------
-
// RaC 10-09 ---------------------
path.push_back(datadir + "/Polygon.png");
nom.push_back("Create Polygon");
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPolygon);
hand.push_back(this);
// RaC 10-09 ---------------------
-
this->addButtons(path, nom);
-
this->setVectorFunction(funct);
this->setEventHandlers(hand);
this->connectEvents();
-
}
-
-
interfNewContourMenu::~interfNewContourMenu()
{
}
-void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event){
-
-
+void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event)
+{
if(!created){
-
panBull = new PanelBullEyeOptions(interfMainPanel::getInstance()->getInfoPanel(),
wxSize(100,200));
created = true;
interfMainPanel::getInstance()->onCreateContoursBullEye(panBull);
//eventHandler->createContourBullsEye(panBull);
interfMainPanel::getInstance()->showPanel(panBull);
-
}
-void interfNewContourMenu::onCreateContourSpline( wxCommandEvent& event ){
+void interfNewContourMenu::onCreateContourSpline( wxCommandEvent& event )
+{
interfMainPanel::getInstance()->onCreateContourSpline();
}
-void interfNewContourMenu::onCreateContourRectangle( wxCommandEvent& event ){
+
+void interfNewContourMenu::onCreateContourRectangle( wxCommandEvent& event )
+{
interfMainPanel::getInstance()->onCreateContourRectangle();
}
-void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event ){
+
+void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event )
+{
interfMainPanel::getInstance()->onCreateContourCircle();
}
-void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event ){
+
+void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event )
+{
interfMainPanel::getInstance()->onCreateContourLine();
}
// RaC 09-09 ---------------------
-void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event ){
+void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event )
+{
interfMainPanel::getInstance()->onCreateContourPoints();
}
// RaC 09-09 ---------------------
// RaC 10-09 ---------------------
-void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event ){
+void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event )
+{
interfMainPanel::getInstance()->onCreateContourPolygon();
}
// RaC 10-09 ---------------------
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
{
int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
-
double range[2];
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 , 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);
+ _isovalue = new wxSlider(this, -1, 40 , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+ _sampling = new wxSlider(this, -1, 20 , 4, 50, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
wxString lstOptions[3];
lstOptions[0]=_T("A");
lstOptions[1]=_T("B");
methodRadiobox = new wxRadioBox(this, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxSize(200,45), 3 , lstOptions, 3, wxRA_SPECIFY_COLS);
methodRadiobox->SetSelection(2);
_staticTextSegmentation = new wxStaticText(this,-1,_T(" "));
-
_mbarrange = new mBarRange(this,70, 65);
_mbarrange->SetMin(0);
_mbarrange->SetStart(0);
-
_mbarrange->SetOrientation( true );
_mbarrange->setActiveStateTo(true);
_mbarrange->setVisibleLabels( true );
_mbarrange->setIfWithActualDrawed( false );
_mbarrange->SetStart( 0 );
_mbarrange->SetEnd( sizeZ );
-
- wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(20,1,0,0);
sizer->Add( new wxStaticText(this, -1, _T("Isovalue (Gray level)")), 1, wxGROW );
sizer->Add( _isovalue, 1, wxGROW );
sizer->Add( methodRadiobox , 1, wxGROW );
sizer->Add( _staticTextSegmentation, 1, wxGROW );
sizer->Add( segmentationAllSliceBtn, 1, wxGROW );
sizer->Add( _mbarrange, 1, wxGROW );
-
this->SetSizer( sizer );
-// panel->SetSize( sizePanel );
- this->SetSize( wxDefaultSize );
this->SetAutoLayout( true );
this->Layout();
-
//_segmentationFrame->SetEventHandler( this );
//segmentationOneSliceBtn->SetEventHandler( this );
//segmentationAllSliceBtn->SetEventHandler( this );
Connect( segmentationAllSliceBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) &interfSegmentationPanelVTK::onSegmentationAllSlice);
}
-
interfSegmentationPanelVTK::~interfSegmentationPanelVTK()
{
}
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
segmentPanelITK->SetSizer(flexsizer, true);
segmentPanelITK->SetAutoLayout( true );
-
wxPanel* panel = new wxPanel(this, -1);//contourevent->getSegmentationPanelITK(segmentPanelITK);
-
wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T(" Automatic ITK Segmentation ")), wxDefaultPosition,
wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
int sampling = _sampling->GetValue();
int method = methodRadiobox->GetSelection();
interfMainPanel::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
-
}
+
void interfSegmentationPanelVTK::onSegmentationAllSlice( wxCommandEvent& event )
{
int minZ=_mbarrange->GetStart();
int maxZ=_mbarrange->GetEnd();
-
int isovalue = _isovalue->GetValue();
int sampling = _sampling->GetValue();
int method = methodRadiobox->GetSelection();
-
interfMainPanel::getInstance()->onSegmentationAllSlice(minZ, maxZ, isovalue, sampling, method);
}
-void interfSegmentationPanelVTK::setLabel(wxString tmpString){
+void interfSegmentationPanelVTK::setLabel(wxString tmpString)
+{
_staticTextSegmentation->SetLabel(tmpString);
}
+
/**
** start of new implementation
** interfSegmentationPanelITK
{
double range[2];
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));
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
-
_distance = new wxTextCtrl(this, wxID_ANY, wxT("5.0"), wxPoint(98,5), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
_sigma = new wxTextCtrl(this, wxID_ANY, wxT("1.2"), wxPoint(98,30), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
_alfa = new wxTextCtrl(this, wxID_ANY, wxT("-1.0"), wxPoint(98,55), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
_propagation = new wxTextCtrl(this, wxID_ANY, wxT("6.0"), wxPoint(98,105), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
_iterations = new wxTextCtrl(this, wxID_ANY, wxT("800"), wxPoint(98,130), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
_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"));
-
//Conexion del boton con su respectivo manejador
Connect(6, wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &interfSegmentationPanelITK::onSegmentationOneSlice);
-
-
}
-interfSegmentationPanelITK::~interfSegmentationPanelITK(){
+interfSegmentationPanelITK::~interfSegmentationPanelITK()
+{
}
void interfSegmentationPanelITK::onSegmentationOneSlice( wxCommandEvent& event )
{
- wxString distanc=_distance->GetValue();
- wxString sigm=_sigma->GetValue();
- wxString alf=_alfa->GetValue();
- wxString bet=_beta->GetValue();
- wxString prop=_propagation->GetValue();
- wxString iter=_iterations->GetValue();
- wxString infS=_infStrength->GetValue();
-
+ wxString distanc = _distance->GetValue();
+ wxString sigm = _sigma->GetValue();
+ wxString alf = _alfa->GetValue();
+ wxString bet = _beta->GetValue();
+ wxString prop = _propagation->GetValue();
+ wxString iter = _iterations->GetValue();
+ wxString infS = _infStrength->GetValue();
interfMainPanel::getInstance()->onSegmentationOneSliceITK(distanc, sigm, alf, bet, prop, iter, infS);
-
}
+
void interfSegmentationPanelITK::onSegmentationAllSlice( wxCommandEvent& event )
{
-
/*int minZ=_mbarrange->GetStart();
int maxZ=_mbarrange->GetEnd();
-
int isovalue = _isovalue->GetValue();
int sampling = _sampling->GetValue();
int method = methodRadiobox->GetSelection();
-
-
interfMainPanel::getInstance()->onSegmentationAllSlice(minZ, maxZ, isovalue, sampling, method);*/
-
}
//------------------------------------------------------------------------------------------------------------
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
{
_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( axisShowBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onAxisShow );
Connect( mirrorGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onMirrorGo );
-
- wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(20,1,0,0);
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 );
-
this->SetSizer( sizer );
this->SetAutoLayout( true );
this->Layout();
}
-interfMirrorPanel::~interfMirrorPanel(){
+interfMirrorPanel::~interfMirrorPanel()
+{
}
void interfMirrorPanel::onAxisShow(wxCommandEvent& event)
{
-
if (!_axisStatus)
{
interfMainPanel::getInstance()->onMirrorAxisShow();
_axisStatus=true;
- }
- else
- {
+ } else {
interfMainPanel::getInstance()->onMirrorAxisHide();
_axisStatus=false;
}
: 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) );
-
+ wxButton *button2 = new wxButton(this,wxID_ANY,_T("Button 2"), wxDefaultPosition, wxSize(200,35) );
Connect( button1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfTestPanel::onButton1Pressed );
Connect( button2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfTestPanel::onButton2Pressed );
-
- wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(20);
sizer -> Add( button1, 1, wxGROW );
sizer -> Add( button2, 1, wxGROW );
-
this->SetSizer( sizer );
this->SetAutoLayout( true );
this->Layout();
** it uses attribute eventHandler to call the methods define by the application.
** see setEventHandler(wxEventHandler*)
**/
-
- void onSegmentationPressed(wxCommandEvent& event);
-
- void onSegmentationPressedITK(wxCommandEvent& event);
-
+ void onSegmentationPressed(wxCommandEvent& event);
+ void onSegmentationPressedITK(wxCommandEvent& event);
void setLabel(wxString tmpString);
-
private:
-
//wxContourEventHandler* contourevent;
- wxPanel* configPanel;
- wxWindow* infoWin;
- wxPanel* segmentPanel;
- wxPanel* spreadPanel;
- wxPanel* segmentPanelITK;
- bool axisshown;
-
- void hideAxis();
-
- wxPanel* getSegmentationPanel(wxWindow* parent);
-
- void onSegmentationOneSlice( wxCommandEvent& event );
-
- void onSegmentationAllSlice( wxCommandEvent& event );
-
- wxSlider* _isovalue;
-
- mBarRange* _mbarrange;
-
- wxSlider* _sampling;
-
- wxStaticText* _staticTextSegmentation;
-
- wxRadioBox* methodRadiobox;
+ wxPanel *configPanel;
+ wxWindow *infoWin;
+ wxPanel *segmentPanel;
+ wxPanel *spreadPanel;
+ wxPanel *segmentPanelITK;
+ bool axisshown;
+ void hideAxis();
+ wxSlider *_isovalue;
+ mBarRange *_mbarrange;
+ wxSlider *_sampling;
+ wxStaticText*_staticTextSegmentation;
+ wxRadioBox *methodRadiobox;
+
+ wxPanel* getSegmentationPanel(wxWindow* parent);
+ void onSegmentationOneSlice( wxCommandEvent& event );
+ void onSegmentationAllSlice( wxCommandEvent& event );
};
class interfSegmentationPanelITK
public:
interfSegmentationPanelITK(wxWindow * parent);
~interfSegmentationPanelITK();
-
-
void onSegmentationOneSlice( wxCommandEvent& event );
-
void onSegmentationAllSlice( wxCommandEvent& event );
-
private:
-
wxTextCtrl * _distance;
wxTextCtrl * _sigma;
wxTextCtrl * _alfa;
public:
interfMirrorPanel(wxWindow * parent);
~interfMirrorPanel();
-
private:
-
wxSlider* _thickness;
-
bool _axisStatus;
-
void onAxisShow(wxCommandEvent& event);
-
void onMirrorGo(wxCommandEvent& event);
-
void onChangeWidth(wxScrollEvent& event);
-
DECLARE_EVENT_TABLE()
};
interfInformationPanel::interfInformationPanel(wxWindow * parent)
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
{
+printf("EED interfInformationPanel::interfInformationPanel Start\n");
//wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
wxString lstOptions[4];
lstOptions[0]=_T("Current Slice");
// lstOptions[2]=_T("All Slices");
_informationRadiobox = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions, 2, wxRA_SPECIFY_COLS);
-
wxString lstOptContOperation[5];
lstOptContOperation[0]=_T("AND");
lstOptContOperation[1]=_T("OR");
_radiolstboxContourGroup->SetSelection(1);
Connect( _radiolstboxContourGroup->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &interfInformationPanel::onContourGroup );
+printf("EED interfInformationPanel::interfInformationPanel 1\n");
- _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") );
- _XYZValues->SetValue(true);
- _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
+ _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") );
+ _XYZValues->SetValue(true);
+ _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
_contourImage->SetValue(true);
-
- _statistics = new wxCheckBox(this, -1, _T("Save Statistics") );
+ _statistics = new wxCheckBox(this, -1, _T("Save Statistics") );
_statistics->SetValue(true);
+
wxButton *informationContourLabelsBtn = new wxButton(this,-1,_T("Contour labels"),wxDefaultPosition, wxSize(140,35) );
+#if wxMAJOR_VERSION <= 2
informationContourLabelsBtn->SetEventHandler( this );
+#else
+ // informationContourLabelsBtn->SetEventHandler( this );
+ printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo informationContourLabelsBtn->SetEventHandler \n");
+#endif
Connect( informationContourLabelsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels );
wxButton *statisticsContourBtn = new wxButton(this,-1,_T("Contour statistics"),wxDefaultPosition, wxSize(140,35) );
+#if wxMAJOR_VERSION <= 2
statisticsContourBtn->SetEventHandler( this );
+#else
+ //statisticsContourBtn->SetEventHandler( this );
+ printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo statisticsContourBtn->SetEventHandler \n");
+#endif
Connect( statisticsContourBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation );
wxButton *showResultImagesBtn = new wxButton(this,-1,_T("Show result images"),wxDefaultPosition, wxSize(140,35) );
+#if wxMAJOR_VERSION <= 2
showResultImagesBtn->SetEventHandler( this );
+#else
+ //showResultImagesBtn->SetEventHandler( this );
+ printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo showResultImagesBtn->SetEventHandler \n");
+#endif
Connect( showResultImagesBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages );
-
wxButton *saveResultsBtn = new wxButton(this,-1,_T("Save Results"),wxDefaultPosition, wxSize(140,35) );
+#if wxMAJOR_VERSION <= 2
saveResultsBtn->SetEventHandler( this );
- Connect( saveResultsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
+#else
+//EED saveResultsBtn->SetEventHandler( this );
+printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo saveResultsBtn->SetEventHandler \n");
+#endif
+ Connect( saveResultsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
+
//_theViewPanel->getSceneManager()->GetImageDataSizeZ();
_mbarrangeSliceInformation = new mBarRange(this,65,65);
_mbarrangeSliceInformation->SetMin(0);
_mbarrangeSliceInformation->SetStart(0);
- _mbarrangeSliceInformation-> SetOrientation( true );
- _mbarrangeSliceInformation-> setActiveStateTo(true);
- _mbarrangeSliceInformation-> setVisibleLabels( true );
- _mbarrangeSliceInformation-> setDeviceEndMargin(10);
- _mbarrangeSliceInformation-> setRepresentedValues( 0 , sizeZ-1 );
- _mbarrangeSliceInformation-> setDeviceBlitStart(10,10);
- _mbarrangeSliceInformation-> setIfWithActualDrawed( false );
- _mbarrangeSliceInformation-> SetStart( 0 );
- _mbarrangeSliceInformation-> SetEnd( sizeZ-1 );
-
-
+ _mbarrangeSliceInformation->SetOrientation( true );
+ _mbarrangeSliceInformation->setActiveStateTo(true);
+ _mbarrangeSliceInformation->setVisibleLabels( true );
+ _mbarrangeSliceInformation->setDeviceEndMargin(10);
+ _mbarrangeSliceInformation->setRepresentedValues( 0 , sizeZ-1 );
+ _mbarrangeSliceInformation->setDeviceBlitStart(10,10);
+ _mbarrangeSliceInformation->setIfWithActualDrawed( false );
+ _mbarrangeSliceInformation->SetStart( 0 );
+ _mbarrangeSliceInformation->SetEnd( sizeZ-1 );
double range[2];
interfMainPanel::getInstance()->getImageRange(range);
+printf("EED interfInformationPanel::interfInformationPanel 2\n");
int min = (int)floor (range[0]);
int max = (int)ceil (range[1]);
Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
+printf("EED interfInformationPanel::interfInformationPanel 3\n");
_staticTextInformation = new wxStaticText(this,-1,_T(" "));
-
_grid = new wxGrid( this,
wxID_ANY,
wxPoint( 0, 0 ),
wxSize( 200, 500 ) );
-
int i,gridCol=10,gridRow=sizeZ+2;
_grid->CreateGrid( 0, 0 );
_grid->AppendRows(gridRow);
_grid->AppendCols(gridCol);
-
for (i=0;i<gridRow;i++)
{
_grid->SetRowLabelValue(i, _T(" ") );
}
// _grid->SetColLabelSize(0);
-
-
FillGridWithContoursInformation();
+
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
wxFlexGridSizer * sizerSave = new wxFlexGridSizer(2,2);
#else
- wxFlexGridSizer * sizerSave = new wxFlexGridSizer(2);
+ wxFlexGridSizer * sizerSave = new wxFlexGridSizer(2,2,0,0);
#endif
sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: ")) , 1, wxGROW );
sizerSave->Add( _XYZValues, 1, wxALL, 2 );
sizerSave->Add( _statistics, 1, wxALL, 2 );
sizerSave->Add( _contourImage, 1, wxALL, 2 );
+
+printf("EED interfInformationPanel::interfInformationPanel 4\n");
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFlexGridSizer * sizerA = new wxFlexGridSizer(10);
+#else
+ wxFlexGridSizer * sizerA = new wxFlexGridSizer(1,10,0,0);
+#endif
sizerA->Add( _informationRadiobox, 1, wxALL, 2 );
sizerA->Add( _radiolstboxContourGroup, 1, wxALL, 2 );
sizerA->Add( sizerSave, 1, wxALL, 2 );
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFlexGridSizer * sizerB = new wxFlexGridSizer(10);
+#else
+ wxFlexGridSizer * sizerB = new wxFlexGridSizer(1,4,0,0);
+#endif
sizerB->Add( informationContourLabelsBtn, 1, wxALL, 2 );
sizerB->Add( statisticsContourBtn, 1, wxALL, 2 );
sizerB->Add( showResultImagesBtn, 1, wxALL, 2 );
#if wxMAJOR_VERSION <= 2
wxFlexGridSizer * sizer = new wxFlexGridSizer(1,8);
#else
- wxFlexGridSizer * sizer = new wxFlexGridSizer(8);
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(20,1,0,0);
#endif
+printf("EED interfInformationPanel::interfInformationPanel 5\n");
sizer->Add( sizerA , 1, wxALL , 0 );
- sizer->Add( new wxStaticText(this ,-1,_T("Slice Range")) , 1, wxALL , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.1\n");
+ sizer->Add( new wxStaticText(this ,1,_T("Slice Range")) , 1, wxALL , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.2\n");
sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW , 2 );
- sizer->Add( new wxStaticText(this ,-1,_T("Gray Range")) , 1, wxALL , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.3\n");
+ sizer->Add( new wxStaticText(this ,1,_T("Gray Range")) , 1, wxALL , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.4\n");
sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW , 2 );
+printf("EED interfInformationPanel::interfInformationPanel 5.5\n");
+
sizer->Add( sizerB , 1, wxEXPAND , 0 );
+
+printf("EED interfInformationPanel::interfInformationPanel 5.6\n");
sizer->Add( _staticTextInformation , 1, wxEXPAND , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.7\n");
sizer->Add( _grid , 1, wxEXPAND , 0 );
-
+printf("EED interfInformationPanel::interfInformationPanel 5.8\n");
this->SetSizer( sizer );
+printf("EED interfInformationPanel::interfInformationPanel 5.9\n");
this->SetSize( wxSize(1500,1500) );
//this->SetBackgroundColour( wxColour(100,100,100) );
this->SetAutoLayout( true );
+printf("EED interfInformationPanel::interfInformationPanel 5.10\n");
this->Layout();
//return panel;
+
+printf("EED interfInformationPanel::interfInformationPanel End\n");
+
}
interfInformationPanel::~interfInformationPanel()
public:
interfInformationPanel(wxWindow * parent);
~interfInformationPanel();
-
void setStringInfoPanel(wxString tmpString);
void setRowLabelInfoPanel(int z,wxString tempString);
void appendCols(int numcols);
void setColLabel(int tmpIntB,wxString tmpTitleString);
wxString getCellValue(int j,int i);
private:
-
- mBarRange* _mbarrangeRangeInformation;
- mBarRange* _mbarrangeSliceInformation;
- wxGrid* _grid;
- wxRadioBox* _informationRadiobox;
- wxRadioBox* _radiolstboxContourGroup;
- wxStaticText* _staticTextInformation;
- wxCheckBox* _XYZValues;
- wxCheckBox* _contourImage;
- wxCheckBox* _statistics;
-
+ mBarRange* _mbarrangeRangeInformation;
+ mBarRange* _mbarrangeSliceInformation;
+ wxGrid* _grid;
+ wxRadioBox* _informationRadiobox;
+ wxRadioBox* _radiolstboxContourGroup;
+ wxStaticText* _staticTextInformation;
+ wxCheckBox* _XYZValues;
+ wxCheckBox* _contourImage;
+ wxCheckBox* _statistics;
void onInformationContourLabels(wxCommandEvent& event);
void onExtractInformation(wxCommandEvent& event);
void onShowResultImages(wxCommandEvent& event);
createContour( 1 );
}
-void wxContourMainFrame::onCreateContourRectangle( ){
+
+void wxContourMainFrame::onCreateContourRectangle( )
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
createContour( 2 );
}
-void wxContourMainFrame::onCreateContourCircle( ){
+
+void wxContourMainFrame::onCreateContourCircle( )
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
createContour( 3 );
}
-void wxContourMainFrame::onCreateContourLine( ){
+void wxContourMainFrame::onCreateContourLine( )
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
}
// RaC 09-09 --------------------------------------
-void wxContourMainFrame::onCreateContourPoints( ){
+void wxContourMainFrame::onCreateContourPoints( )
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
// RaC 09-09 --------------------------------------
// RaC 10-09 --------------------------------------
-void wxContourMainFrame::onCreateContourPolygon( ){
+void wxContourMainFrame::onCreateContourPolygon( )
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
_theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc , 4) ;
}
}
+
void wxContourMainFrame :: createContour( int typeContour )
{
//Creating the manualContourModel and including in the model
manualBaseModel * manModelContour = kernelManager->factoryManualContourModel(typeContour);
-
std::vector<int> instantVector;
_instantPanel->getInstant( instantVector );
std::string theName = kernelManager->createOutline(manModelContour, instantVector);
-
/*std::vector<int> instantVector;
_instantPanel->getInstant( instantVector );
std::string theName;
//Adding the manualViewContour to interface objects structure
//_sceneManager->setControlActiveStateOfALL( false );//This call is being done here because if the ROI is created underneath the previously created ROIS will still be active.
_theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc , typeContour) ;
- }
-
+ } // if addedModel
}
+
manualBaseModel * wxContourMainFrame::factoryManualContourModel(wxPanel* panel){
manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
void wxContourMainFrame::FlipSelectedContours(int flipDirection)
{
- printf("EED wxContourMainFrame::FlipSelectedContours flipDirection=%d \n", flipDirection );
FlipLstOfContours(
(std::vector<std::string>)_theViewPanel->getSceneManager()->getSelectedObjects() ,
flipDirection
void wxContourMainFrame::FlipActualSliceContours(int flipDirection)
{
- printf("EED wxContourMainFrame::FlipActualSliceContours flipDirection=%d \n", flipDirection );
FlipLstOfContours(
(std::vector<std::string>)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() ,
flipDirection
void wxContourMainFrame::FlipAllContours(int flipDirection)
{
- printf("EED wxContourMainFrame::FlipAllContours flipDirection=%d \n", flipDirection );
FlipLstOfContours(
kernelManager->GetLstNameThings() ,
flipDirection
void setConceptValue( std::string name, int value );
ConceptDataWrap* getLastConceptData();
bool getIfConceptCheckedAt( std::string name, int pos );
-
void changeInstant();
-
int getNamesWrappingSize();
-
std::string getNameWrapping(int i);
-
void updateInstantOutlines();
void updateInstantImageData();
void updateInstantAxes();
-
void onChangeDeep(int val);
-
///////////////////////////
void onCopy();
void onPaste();
void onImport();
void onTest();
void openContours( FILE *pFile, FILE *pFileData, bool staticContour );
-
void RefreshInterface();
-
vtkImageData* getImageData();
-
void onSegmentationOneSlice(int isovalue,int sampling,int method);
void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
void FlipAllContours(int flipDirection);
void FlipLstOfContours(std::vector<std::string> lstNameThings, int flipDirection);
-
//====================================================================================================
void showAxis(bool show);
//
// @param typeContourGroup - int The operation id (AND,OR,XOR,ALL=3)
//
- void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax);
- void onSaveResults(std::string directory,std::string namefile, std::string filename,
- int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
- void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
- void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
- void onSnakePressed();
- void saveFileWithContoursAutomatique();
- void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ );
+ void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax);
+ void onSaveResults(std::string directory,std::string namefile, std::string filename,
+ int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
+ void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
+ void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
+ void onSnakePressed();
+ void saveFileWithContoursAutomatique();
+ void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ );
wxPanel *getMaskImageViewPanel(wxWindow *parent);
- void SetContourGroup(int contourGroup);
+ void SetContourGroup(int contourGroup);
wxPanel *getThresholdImageViewPanel(wxWindow *parent);
wxPanel *getColorLayerImageViewPanel(wxWindow *parent);
-
//CMRU 17-08-09-----------------------------------------------------------------------------------------------
/**
createVerticalBar(1,200);
createViewPanel();
_eventHandler = NULL;
-
wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1,4, gapV, gapH);
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
panelSizer->AddSpacer(gapV);
panelSizer->Add(theViewPanel, 1, wxEXPAND);
panelSizer->AddSpacer(gapV);
-
outSizer = new wxFlexGridSizer(3, 1, gapH, gapV);
//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
#if wxMAJOR_VERSION <= 2
outSizer->Add( _horizontalBar, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP);
outSizer->Add( panelSizer, 1, wxEXPAND);
outSizer->AddSpacer(gapH);
-
_horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + 2*gapH, gapV);
_horizontalBar->setDeviceEndMargin( 2*gapH+10 );
-
//Connecting the events to the horizontal bar
Connect(_horizontalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Horizontal );
Connect(_horizontalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onActualChange_Bar_Horizontal );
Connect( wxID_ANY, wxEVT_START_CREATE_ROI, (wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onCreateROI );
Connect( wxID_ANY, wxEVT_STOP_CREATE_ROI, (wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onStopCreateROI );
Connect( wxID_ANY, wxEVT_CHANGED_DEEP, (wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onChangedDeep );
- Connect( wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContourViewPanel :: onActionButtonPressed );
+ Connect( wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContourViewPanel :: onActionButtonPressed );
}
- wxVtkBaseView_SceneManager* wxContourViewPanel::getSceneManager(){
+ wxVtkBaseView_SceneManager* wxContourViewPanel::getSceneManager()
+ {
return _sceneManager;
}
// Class definition
//------------------------------------------------------------------------------------------------------------
-class wxContourViewPanel : public wxPanel {// public wxScrolledWindow {
-
+class wxContourViewPanel : public wxPanel
+{
public:
-
//------------------------------------------------------------------------------------------------------------
// Constructors & Destructors
//------------------------------------------------------------------------------------------------------------
-
wxContourViewPanel( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos=wxDefaultPosition, const wxSize& size = wxDefaultSize,long style= wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, int vertStart=1, int vertEnd=1, int horzStart=1, int horzEnd=1 );
-
~wxContourViewPanel();
-
//------------------------------------------------------------------------------------------------------------
// Creational and initialization methods
//------------------------------------------------------------------------------------------------------------
-
void setWxEventHandler( wxEvtHandler * theEventHandler );
-
void createHorizontalBar(int horzStart, int horzEnd);
-
void createVerticalBar(int vertStart, int vertEnd);
-
void createViewPanel();
-
//------------------------------------------------------------------------------------------------------------
// Methods for capturing events from the horizontal bar
//------------------------------------------------------------------------------------------------------------
-
/**
* Handles the event wxEVT_TSBAR from the horizontal bar
*/
{
return _wxVtk_BaseView;
}
+
//------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: configureViewControlTo( std::string theKeyName, manualBaseModel * manModelContour, double * spc,int typeContour)
+ void wxVtkBaseView_SceneManager::configureViewControlTo( std::string theKeyName, manualBaseModel * manModelContour, double * spc,int typeContour)
{
//setControlActiveStateOfALL( false );
_creatingROI = true;
_lastInteraction->getControler()->SetActive( false );
this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
}
-
-
manualContourBaseControler *manContourControl;
manualViewBaseContour *manViewerContour;
-
// Creating the view manualViewContour and the manualContourControler
// NOTE: The model is created in the KernelManagerContour class, factoryManualContourModel method
if (typeContour==1)
_contours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, newContourWrap ));
return newContourWrap;
}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: desconfigureViewControlOf( std::string theKeyName )
- {
-
+ {
}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: removeWrap( std::string theKeyName )
{
this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
this->_vtkInteractorStyleBaseView->EvaluateToRefresh();
}
+
//------------------------------------------------------------------------------------------------------------
ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: getContourWrap_ViewControlOf ( std::string theName )
{
return iter->second;
//return iter->first;
}
+
//------------------------------------------------------------------------------------------------------------
ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: getContourWrap_ViewControlOf ( std::string theName, std::map<std::string, ContourWrap_ViewControl *> * theMap )
{
iter = theMap->find( theName );
return iter->second;
}
+
//------------------------------------------------------------------------------------------------------------
manualContourBaseControler * wxVtkBaseView_SceneManager :: getControlerOf( std::string theName )
{
return getContourWrap_ViewControlOf ( theName )->getControler();
}
+
//------------------------------------------------------------------------------------------------------------
manualViewBaseContour * wxVtkBaseView_SceneManager :: getViewerOf( std::string theName )
{
return getContourWrap_ViewControlOf ( theName )->getViewer();
}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: set_creatingMULT_ROI( bool condition )
{
_creatingMULT_ROI = condition;
}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: set_editingROI( bool condition )
{
_editingROI = condition;
}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: set_toIncludeAtInteractionGroup( bool condition )
{
_toIncludeAtInteractionGroup = condition;
}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: set_waiting( bool condition )
{
_waiting = condition;
}
+
//------------------------------------------------------------------------------------------------------------
bool wxVtkBaseView_SceneManager :: get_creatingMULT_ROI( )
{
return _creatingMULT_ROI;
}
+
//------------------------------------------------------------------------------------------------------------
bool wxVtkBaseView_SceneManager :: get_editingROI( )
{
return _editingROI;
}
+
//------------------------------------------------------------------------------------------------------------
bool wxVtkBaseView_SceneManager :: get_toIncludeAtInteractionGroup( )
{
#include "KernelManagerContour.h"
-KernelManagerContour::KernelManagerContour(){
-
-
+KernelManagerContour::KernelManagerContour()
+{
/**THIS ALL SHOULD BE IN AN OTHER LIB CALLED PERSISTANCE
**
**/
- inredo = 0;
- inundo = 0;
-
+ inredo = 0;
+ inundo = 0;
time_t seconds;
- seconds = time (NULL);
- int time = seconds;
-
-
- stundoredo = "data/temp"+intToString(time);
- _currentIndex = 0;
-
+ seconds = time (NULL);
+ int time = seconds;
+ stundoredo = "data/temp"+intToString(time);
+ _currentIndex = 0;
_contourPropagation = NULL;
#if(WIN32)
mkdir(stundoredo.c_str());
/**
** FINISH PERSISTANCE
**/
-
}
+
KernelManagerContour::KernelManagerContour(std::vector<vtkImageData*> images,std::string datadir,std::string tmpdir)
{
-
-
/**THIS ALL SHOULD BE IN AN OTHER LIB CALLED PERSISTANCE
**
**/
- inredo = 0;
- inundo = 0;
-
+ inredo = 0;
+ inundo = 0;
time_t seconds;
- seconds = time (NULL);
- int time = seconds;
-
-
+ seconds = time (NULL);
+ int time = seconds;
stundoredo = tmpdir+"/temp"+intToString(time);
_currentIndex = 0;
-
_contourPropagation = NULL;
#if(WIN32)
mkdir(tmpdir.c_str());
**/
setVectImages(images);
initializeEnvironment(datadir);
-
}
KernelManagerContour::~KernelManagerContour()
{
double spc[3];
std::vector<double> vectspc;
-
- for(int i = 0; i < (int)(vectimg.size()); i++){
+ for(int i = 0; i < (int)(vectimg.size()); i++)
+ {
vtkImageData* img = vectimg[i];
vtkImageChangeInformation* change = vtkImageChangeInformation::New();
-
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
change->SetInformationInput(img);
#else
change->SetInputData(img);
#endif
-
img->GetSpacing(spc);
change->SetOutputSpacing(1,1,1);
-
//EED 18 fev 2014
change->SetOutputOrigin (0, 0, 0);
-
change->Update();
vectspc.clear();
-
vectspc.push_back(spc[0]);
vectspc.push_back(spc[1]);
vectspc.push_back(spc[2]);
vectimagesSpacing.push_back(vectspc);
vectimg[i] = change->GetOutput();
- }
-
+ } // for i
vectimages = vectimg;
}
-
void KernelManagerContour::GetSpacing(double *vecspc, int iImage)
{
vecspc[0]=vectimagesSpacing[iImage][0];
vecspc[2]=vectimagesSpacing[iImage][2];
}
-
-void KernelManagerContour::initializeEnvironment(std::string datadir){
+void KernelManagerContour::initializeEnvironment(std::string datadir)
+{
_datadir = datadir;
std::string conceptsFN = datadir+"holaConceptsFile.cf";
std::string imageSourcesFN = datadir+"holaImagesInstantsFile.of";
std::map<std::string, AxeThing *>* axesMap = new std::map<std::string, AxeThing *>();
std::map<std::string, ContourThing *>* outlinesMap = new std::map<std::string, ContourThing *>();
- for(int i = 0; i < (int)(vectimages.size()); i++){
+ for(int i = 0; i < (int)(vectimages.size()); i++)
+ {
vtkImageData* selectedimage = vectimages[i];
- ImageSourceThing * thing = new ImageSourceThing(selectedimage);
+ ImageSourceThing * thing = new ImageSourceThing(selectedimage);
std::string imgstring = "Source Image "+intToString(i+1);
sourcesMap->insert(std::pair<std::string, ImageSourceThing *>( imgstring, thing));
- }
-
+ } // for
OutlineModelBuilder * _builder = new OutlineModelBuilder( conceptsFN ,datadir);
_builder->buildImageSource_Envornment( imageSourcesFN, sourcesMap );
_builder->buildImageSection_Envornment( imageSectionsFN, sectionsMap );
_builder->buildAxe_Envornment(axeThingsFN, axesMap );
_builder->buildCountour_Envornment( imageSectionsFN, outlinesMap );
-
//Creating the objects to manage
modelManager = new OutlineModelManager( _builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(), _builder->getContourEnv() );
-
imageSource = modelManager->getImageSourceThingByKeyName( "Source Image 1" );
-
}
-vtkImageData* KernelManagerContour::getSourceImage(){
+
+vtkImageData* KernelManagerContour::getSourceImage()
+{
return imageSource->getSourceImage();
}
-OutlineModelManager* KernelManagerContour::getOutlineModelManager(){
+
+OutlineModelManager* KernelManagerContour::getOutlineModelManager()
+{
return modelManager;
}
-std::string KernelManagerContour::createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector){
+std::string KernelManagerContour::createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector)
+{
return modelManager->createOutline( manModelContour, instantVector );
}
-std::string KernelManagerContour::intToString(int num){
+std::string KernelManagerContour::intToString(int num)
+{
std::string result;
- if(num == 0){
+ if(num == 0)
+ {
result = "0";
}else{
int k=num;
- while (k > 0){
+ while (k > 0)
+ {
char temp = k % 10 + 48;
k = k / 10;
result = temp + result;
- }
- }
+ } // while
+ } // if num
return result;
}
-std::vector<std::string> KernelManagerContour::GetLstNameThingsStatic(){
+std::vector<std::string> KernelManagerContour::GetLstNameThingsStatic()
+{
return modelManager->GetLstNameThingsStatic();
}
-void KernelManagerContour::SaveThingName(FILE* pFile, FILE *pFileData, std::string name ){
+void KernelManagerContour::SaveThingName(FILE* pFile, FILE *pFileData, std::string name )
+{
modelManager->SaveThingName(pFile, pFileData, name);
}
-std::vector<std::string> KernelManagerContour::GetLstNameThings(){
+
+std::vector<std::string> KernelManagerContour::GetLstNameThings()
+{
return modelManager->GetLstNameThings();
}
+
//int KernelManagerContour::IsPartOfStaticList(std::string keyName ){
// return modelManager->IsPartOfStaticList(keyName);
//}
-bool KernelManagerContour::IsPartOfStaticList(std::string theKeyName){
+bool KernelManagerContour::IsPartOfStaticList(std::string theKeyName)
+{
return modelManager->IsPartOfStaticList(theKeyName) == -1;
}
-void KernelManagerContour::deleteCModel(std::string theKeyName){
+void KernelManagerContour::deleteCModel(std::string theKeyName)
+{
manualBaseModel* cModel = modelManager->getOutlineByKeyName(theKeyName)->getModel();
modelManager->removeOutline( theKeyName );
-
delete cModel;
}
-void KernelManagerContour::removeAllOutlines(){
+void KernelManagerContour::removeAllOutlines()
+{
modelManager->removeAllOutlines();
}
-std::vector<NameWrapper *> KernelManagerContour::getActualInstantOutlines(){
+std::vector<NameWrapper *> KernelManagerContour::getActualInstantOutlines()
+{
return modelManager->getActualInstantOutlines();
}
-int KernelManagerContour::getNamesWrappingSize(){
+int KernelManagerContour::getNamesWrappingSize()
+{
return getActualInstantOutlines().size();
}
-std::string KernelManagerContour::getNameWrapping(int i){
+std::string KernelManagerContour::getNameWrapping(int i)
+{
return getActualInstantOutlines()[i]->getKeyName();
}
-void KernelManagerContour::setInstant(Instant * theInstant){
+void KernelManagerContour::setInstant(Instant * theInstant)
+{
modelManager->setInstant(theInstant);
//_actualInstant = theInstant;
}
-Instant * KernelManagerContour::getCurrentInstant(){
+Instant * KernelManagerContour::getCurrentInstant()
+{
return modelManager->getInstant();
}
-void KernelManagerContour::setInstant(std::vector<int> vectInstant){
+
+void KernelManagerContour::setInstant(std::vector<int> vectInstant)
+{
Instant* act = new Instant ( &vectInstant );
modelManager->setInstant(act);
}
return modelManager->getOutlineByKeyName (cloneName )->getModel();
}
-bool KernelManagerContour::onRedo(std::string& filename){
- if(inredo > 0){
+bool KernelManagerContour::onRedo(std::string& filename)
+{
+ if(inredo > 0)
+ {
inredo--;
inundo++;
std::string str = intToString(inundo);
filename = stundoredo + str + ".roi";
//loadState(temp);
return true;
- }
+ } // inredo
return false;
}
-bool KernelManagerContour::onUndo(std::string& filename){
- if(inundo>0){
+bool KernelManagerContour::onUndo(std::string& filename)
+{
+ if(inundo>0)
+ {
inredo++;
inundo--;
-
//char str[9000];
//itoa(inundo, str, 10);
std::string str = intToString(inundo);
-
-
filename = stundoredo + str + ".roi";
-
return true;//loadState(temp);
}
return false;
}
-std::string KernelManagerContour::saveState(){
+std::string KernelManagerContour::saveState()
+{
inredo=0;
std::string str = intToString(inundo);
std::string temp = stundoredo + str + ".roi";
return temp;
}
-bool KernelManagerContour::onUndoSaveFile(std::string& filename){
- if(inundo>0){
- if(inredo==0){
-
+bool KernelManagerContour::onUndoSaveFile(std::string& filename)
+{
+ if(inundo>0)
+ {
+ if(inredo==0)
+ {
//char str[9000];
//itoa(inundo, str, 10);
std::string str = intToString(inundo);
-
filename = stundoredo + str + ".roi";
return true;
//saveFileWithContours(temp);
-
- }
- }
+ } // if inundo ==0
+ } // if inundo > 0
return false;
}
{
_contourPropagation = new ContourPropagation();
}
-
- if (vecX->size()!=0){
-
+ if (vecX->size()!=0)
+ {
int i,size=vecZ->size();
int actualSlice = instants[1];
for ( i=0 ; i<size ; i++ )
{
(*vecZ)[i] = actualSlice;
} // for
-
_contourPropagation->appendContour(vecX , vecY , vecZ);
return intToString(actualSlice);
}
return "";
}
-
void KernelManagerContour::getMaxMinZ(double *minZ,double *maxZ)
{
if (_contourPropagation!=NULL)
}
}
-
void KernelManagerContour::CalculeSplinePropagation()
{
_contourPropagation->setInterpolationNumber(100);
{
bool addedModel = false;
manualBaseModel* manModelContour=NULL;
-
- if (_contourPropagation->ifSliceKeyContourExist(z)==false){
-
+ if (_contourPropagation->ifSliceKeyContourExist(z)==false)
+ {
manModelContour = factoryManualContourModel( typeofcontour );
-
int idTmp = _contourPropagation->FindIdWithZ(z);
-
if (type==0) // Initial Points
{
_contourPropagation->GetInitialControlPoints( idTmp , vecCtrlPointX,vecCtrlPointY,vecCtrlPointZ);
manModelContour->AddPoint( (*vecCtrlPointX)[j] , (*vecCtrlPointY)[j] , -900 );
//--------------------------------------------------------------------
} // for j
-
tempVector[1]=z;
theName = modelManager->createOutline( manModelContour, tempVector );
addedModel = theName.compare("") != 0;
- if(!addedModel){
+ if(!addedModel)
+ {
manModelContour = NULL;
}
-
}// ifSliceKeyContourExist
return manModelContour;
}
-manualBaseModel * KernelManagerContour::factoryManualContourModel(int typeContour)
+manualBaseModel *KernelManagerContour::factoryManualContourModel(int typeContour)
{
manualBaseModel *manModelContour=NULL;
-
// Creating the model
// NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
-
// spline
if (typeContour==0)
{
manModelContour = new manualContourModel();
}
-
// spline
if (typeContour==1)
{
manModelContour = new manualContourModel();
}
-
// rectangle
if (typeContour==2)
{
manModelContour = new manualContourModelRoi();
}
-
// circle
if (typeContour==3)
{
manModelContour = new manualContourModelCircle();
}
-
// line
if (typeContour==6)
{
manModelContour = new manualContourModelLine();
}
-
// points
if (typeContour==7)
{
manModelContour = new manualBaseModel();
}
-
// polygon
if (typeContour==10)
{
manModelContour = new manualContourModelPolygon();
}
-
return manModelContour;
}