#include "interfMainPanel.h"
-interfMainPanel* interfMainPanel::interfmainpanel=NULL;
-wxFrame* interfMainPanel::_newframe=NULL;
+interfMainPanel *interfMainPanel::interfmainpanel = NULL;
+wxFrame *interfMainPanel::_newframe = NULL;
interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
: wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
{
-
PANEL = "New Contour";
PANEL1 = "I/O";
PANEL2 = "Edit";
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("")));
-
- wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1);
+ 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,9*73);
-
+ 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
+#if wxMAJOR_VERSION <= 2
sizer->Remove(currentWindow);
- }
+#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
+#if wxMAJOR_VERSION <= 2
sizer->Remove(currentWindow);
+#else
+ sizer->Detach(currentWindow);
+#endif
+
}
wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
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);
+ // Borrame wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
+ wxFlexGridSizer * sizerPanel = new wxFlexGridSizer(1);
+
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 );
+ 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);
}
void interfConfigurationPanel::OnInterpolation(wxCommandEvent& event)
{
-
interfMainPanel::getInstance()->onInterpolation(_interpolationCheckBox->GetValue());
/* // if */
wxString newstring;
//newstring.Printf("%s %d -",_wxtextctrlSpread->GetValue(), actualSlice );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
newstring.append(wxString(_wxtextctrlSpread->GetValue(),wxConvUTF8));
+#else
+ newstring.append( _wxtextctrlSpread->GetValue() );
+#endif
+
+
newstring.append(wxString(" ",wxConvUTF8));
newstring.append(wxString(val.c_str(),wxConvUTF8));
_wxtextctrlSpread->SetValue(newstring);
** Begin of information panel
**/
interfInformationPanel::interfInformationPanel(wxWindow * parent)
- : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+ //: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+ : wxPanel(parent, -1)
{
+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 ) );
+ wxSize( 200, 250 ) );
-
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,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 );
sizerB->Add( saveResultsBtn, 1, wxALL, 2 );
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFlexGridSizer * sizer = new wxFlexGridSizer(1,8);
+#else
+ 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, wxALL|wxGROW , 0 );
- sizer->Add( _staticTextInformation , 1, wxALL|wxGROW , 0 );
++
++
+ 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->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()
void interfInformationPanel::onSaveResults(wxCommandEvent& event)
{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxSAVE );
+#else
+ wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxFD_SAVE );
+#endif
if (dialog.ShowModal() == wxID_OK)
{
onExtractInformation( event );
// _gridPanel = NULL;
// _drawToolsPanel = NULL;
// _operationsToolsPanel = NULL;
- //_autoFormsPanel = NULL;
+ //_autoFormsPanel = NULL;
// _standardToolsPanel = NULL;
// _editionToolsPanel = NULL;
// _listViewPanel = NULL;
// _sceneManager = NULL;
- //_actualInstant = NULL;
- _numberOfVariablesStatistics = 6+1;
+ //_actualInstant = NULL;
+ _numberOfVariablesStatistics= 6+1;
_refLineControl = NULL;
_refLineModel = NULL;
_viewThresholdImage = NULL;
_viewThresholdImagePanel = NULL;
_viewColorLayerImagePanel = NULL;
++
+ _frameShowResultImages = NULL;
}
- wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
+ wxContourMainFrame::wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
: wxPanel(parent, id, pos, size, style)
{
m_mgr.SetManagedWindow(this);
_contourGroup = 1;
_creatingContoursActive = false;
_theViewPanel = NULL;
-
_instantPanel = NULL;
_refLineControl = NULL;
_refLineModel = NULL;
inredo = 0;
inundo = 0;
_pannew = interfMainPanel::getInstance(this,datadir+"/data/Icons");//, eventHandler);
- _performingOperation = new PerformingOperation();
- _performingOperation = new PerformingOperation();
++ _performingOperation = new PerformingOperation();
if(images.size() > 0)
{
this->setVectImages(images);
void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
{
-
_images = imgs;
-
#if defined(__GNUC__)
std::string str_home(getenv("HOME"));
#elif defined(_WIN32)
- std::string str_home(getenv("USERPROFILE"));
+ std::string str_home(getenv("USERPROFILE"));
#endif
- std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
-
+ std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
std::vector<std::string> conceptNameVect;
std::vector<int> conceptSizeVect;
-
notebook = this->createNotebook();
-
-
- kernelManager = new KernelManagerContour( imgs , _datadir+"/data/" , strCreaContourDataTmp );
-
-
- _instantPanel = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
- _theViewPanel = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );
-
+ kernelManager = new KernelManagerContour( imgs , _datadir+"/data/" , strCreaContourDataTmp );
+ _instantPanel = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
+ _theViewPanel = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );
//-------------------------------------------------------------
kernelManager->getConceptsInformation(conceptNameVect, conceptSizeVect);
_instantPanel->addConcepts(conceptNameVect, conceptSizeVect);
-
-
double val = _theViewPanel->getCurrentDeep();
_instantPanel->setConceptValue( "Axe Depth", (int)val );
//JCP _instantPanel->setConceptValue("time", num de imagenes);
ConceptDataWrap * data = _instantPanel->getConceptDataOf( "Axe Depth" );
//*******************changeInstant();
_theViewPanel->setVerticalConcept( "Axe Depth", data->getMinValue(), data->getMaxValue(), data->getMinShowedValue(), data->getMaxShowedValue(), data->getActualValue() );
-
this->configurePanels( );
-
}
notebook->AddPage( _theViewPanel, wxT(" View ") );
m_mgr.Update();
}
-
-
if( configured )
{
notebook->AddPage( _instantPanel, wxT("Instant Page") );
m_mgr.Update();
}
-
m_mgr.AddPane(notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
m_mgr.Update();
-
SetMinSize(wxSize(300,300));
m_mgr.Update();
return configured;
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();
return manModelContour;
}
-void wxContourMainFrame :: saveState(){
+void wxContourMainFrame :: saveState()
+{
std::string temp = kernelManager->saveState();
saveFileWithContours(temp);
}
-void wxContourMainFrame::onDeleteContour(){
+void wxContourMainFrame::onDeleteContour()
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
}
}
-void wxContourMainFrame :: deleteContour( std::string theKeyName ){
+void wxContourMainFrame :: deleteContour( std::string theKeyName )
+{
/*
manualContourModel * cModel;
manualViewBaseContour * cViewer;
JCP --08-09-2008 */
}
-void wxContourMainFrame::setConceptValue( std::string name, int value ){
+void wxContourMainFrame::setConceptValue( std::string name, int value )
+{
_instantPanel->setConceptValue(name, value);
}
-ConceptDataWrap* wxContourMainFrame::getLastConceptData(){
+ConceptDataWrap* wxContourMainFrame::getLastConceptData()
+{
return _instantPanel->getLastConceptData();
}
-bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos ){
+bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos )
+{
return _instantPanel->getIfConceptCheckedAt( name, pos );
}
nTypeView.push_back(2);
nTypeView.push_back(0);
- wxFrame *frame = new wxFrame(this, -1,_T("Result image extracted.."),wxDefaultPosition,wxSize(600,600), wxDEFAULT_FRAME_STYLE|wxSTAY_ON_TOP);
- wxAuiManager *m_mgr_noteBookViewerResult = new wxAuiManager();
- m_mgr_noteBookViewerResult->SetManagedWindow(frame);
+ if (_frameShowResultImages==NULL)
+ {
+ // wxFrame *_frameShowResultImages = new wxFrame(this, -1,_T("Result image extracted.."),wxDefaultPosition,wxSize(600,600), wxDEFAULT_FRAME_STYLE|wxSTAY_ON_TOP);
+ _frameShowResultImages = new wxFrame(this, -1,_T("Result image extracted.."),wxDefaultPosition,wxSize(600,600),
+ wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
+
+ wxAuiManager *m_mgr_noteBookViewerResult = new wxAuiManager();
+ m_mgr_noteBookViewerResult->SetManagedWindow(_frameShowResultImages);
- wxAuiNotebook* noteBookViewerResult = new wxAuiNotebook(frame, -1, wxPoint(600, 600), wxSize(430,200), m_notebook_style);
- m_mgr_noteBookViewerResult->AddPane(noteBookViewerResult, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
+ wxAuiNotebook* noteBookViewerResult = new wxAuiNotebook(_frameShowResultImages, -1, wxPoint(600, 600), wxSize(430,200), m_notebook_style);
+ m_mgr_noteBookViewerResult->AddPane(noteBookViewerResult, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
- wxPanel *panelViewer1 = new wxMaracas_N_ViewersWidget(noteBookViewerResult, value,&nTypeView);
- wxPanel *panelViewer2 = new wxMaracas_N_ViewersWidget(noteBookViewerResult, mask,&nTypeView);
+ wxPanel *panelViewer1 = new wxMaracas_N_ViewersWidget(noteBookViewerResult, value,&nTypeView);
+ wxPanel *panelViewer2 = new wxMaracas_N_ViewersWidget(noteBookViewerResult, mask,&nTypeView);
- noteBookViewerResult->AddPage( panelViewer1, wxT("Image result") );
- noteBookViewerResult->AddPage( panelViewer2, wxT("Mask result") );
- m_mgr_noteBookViewerResult->Update();
- frame->Show();
+ noteBookViewerResult->AddPage( panelViewer1, wxT("Image result") );
+ noteBookViewerResult->AddPage( panelViewer2, wxT("Mask result") );
+ m_mgr_noteBookViewerResult->Update();
+ _frameShowResultImages->Show();
+ } // if _frameShowResultImages
}
std::vector<int> instantVect;
_instantPanel->getInstant( instantVect );
int actualSlice = instantVect[1];
-
kernelManager->setInstant(instantVect);
-
// Refresh Mask image
- if(_viewMaskImage!=NULL){
+ if(_viewMaskImage!=NULL)
+ {
_viewMaskImage->SetZ(actualSlice);
if (_viewMaskImagePanel->IsVisible()==true)
{
getMaskValue(&mask,&value, _contourGroup , 0, -1, -1);
_viewMaskImage->onThreshold();
}
- }
-
+ } // if _viewMaskImage
// Refresh Threshold image
- if(_viewThresholdImage!=NULL){
+ if(_viewThresholdImage!=NULL)
+ {
_viewThresholdImage->SetZ(actualSlice);
- if (_viewThresholdImagePanel->IsVisible()==true){
+ if (_viewThresholdImagePanel->IsVisible()==true)
+ {
_viewThresholdImage->onThreshold();
}
- }
-
-
+ } // if _viewThresholdImage
updateInstantOutlines();
updateInstantImageData();
updateInstantAxes();
-void wxContourMainFrame :: updateInstantOutlines()
+void wxContourMainFrame::updateInstantOutlines()
{
_theViewPanel->removeSceneContours();
_theViewPanel->addNameWrapperToScene();
//}
}
-int wxContourMainFrame::getNamesWrappingSize(){
+int wxContourMainFrame::getNamesWrappingSize()
+{
return kernelManager->getNamesWrappingSize();
}
-std::string wxContourMainFrame::getNameWrapping(int i){
+
+std::string wxContourMainFrame::getNameWrapping(int i)
+{
return kernelManager->getNameWrapping(i);
}
void wxContourMainFrame::onCopy(){
std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects();
-
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
_performingOperation->reset();
_performingOperation->setKeyNamesOperationElems( currentSelection );
}
-void wxContourMainFrame::onPaste(){
-
-
+void wxContourMainFrame::onPaste()
+{
char theStartCommand = _performingOperation->getStartCommand();
if ( theStartCommand == COPY )
{
}
}
}
-void wxContourMainFrame::onUndo(){
+
+void wxContourMainFrame::onUndo()
+{
std::string filename;
if(kernelManager->onUndoSaveFile(filename)){
saveFileWithContours(filename);
_theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append );
}
-//EED04
-void wxContourMainFrame ::loadState(std::string filename){
-
+void wxContourMainFrame ::loadState(std::string filename)
+{
deleteAllContours();
onLoadContours(filename,false);
-
- /* EED Borrame
- char tmp[255];
- FILE *pFile=fopen(filename.c_str(),"r+");
-
- fscanf(pFile,"%s",tmp); // --CreaContour--
-
- fscanf(pFile,"%s",tmp); // Version
- fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
-
- deleteAllContours();
-
- loadContours(pFile, false);
- loadContours(pFile, true);
-
- fclose(pFile);
- */
-}
-
-
-//EED03
-/*EED Borrame
-void wxContourMainFrame::loadContours( FILE *pFile, bool staticContour )
-{
- char tmp[255];
-
- if (staticContour==false)
- {
- fscanf(pFile,"%s",tmp); // ImageDimensions
- fscanf(pFile,"%s",tmp); // X
- fscanf(pFile,"%s",tmp); // Y
- fscanf(pFile,"%s",tmp); // Z
-
- fscanf(pFile,"%s",tmp); // ImageSpacing
- fscanf(pFile,"%s",tmp); // X
- fscanf(pFile,"%s",tmp); // Y
- fscanf(pFile,"%s",tmp); // Z
- }
-
- fscanf(pFile,"%s",tmp); // NumberOfContours
- fscanf(pFile,"%s",tmp); // ##
- int numberOfContours = atoi(tmp);
-
- std::vector<int> instantVector;
- int typeContourModel;
- manualBaseModel *manModelContour;
- int typeView;
-
- int i;
- for (i=0;i<numberOfContours;i++)
- {
- instantVector.clear();
- fscanf(pFile,"%s",tmp); // Instant
- fscanf(pFile,"%s",tmp); // 1
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 2
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 3
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 4
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 5
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 6
- instantVector.push_back( atoi(tmp) );
-
- fscanf(pFile,"%s",tmp); // TypeContourModel
- fscanf(pFile,"%s",tmp); // ##
- typeContourModel = atoi(tmp);
-
- manModelContour = kernelManager->factoryManualContourModel(typeContourModel);
- manModelContour->Open(pFile);
-
- fscanf(pFile,"%s",tmp); // TypeView
- fscanf(pFile,"%s",tmp); // ##
- typeView = atoi(tmp);
-
- std::string theName;
- theName = kernelManager->createOutline( manModelContour, instantVector );
- bool addedModel = theName.compare("") != 0;
- if( addedModel )
- {
- double spc[3];//Si no hay imagen pero hay contornos que spacing se pone por default
- _theViewPanel->getSpacing(spc);
- //Adding the manualContourControler to interface objects structure
- //Adding the manualViewContour to interface objects structure
- //_theViewPanel->getSceneManager()->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 , typeView) ;
- }
-
- if (staticContour==true)
- {
- Instant instant(&instantVector);
- kernelManager->changeContourOfManager( theName , &instant );
- }
- }// for numberOfContours
}
-*/
void wxContourMainFrame::onLoad()
if(GetFileLocation().empty())
{
//------------------------------------------------------------------------------------------------------------
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxOPEN );
+#else
+ wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxFD_OPEN );
+#endif
if (dialog.ShowModal() == wxID_OK)
{
fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
void wxContourMainFrame::SetZForAllContours(int pz)
{
-
//-- Normal Contours
-
std::vector< std::string > lstNameThings;
int i,sizeLstNameThings;
int ii,sizeLstPoints;
}// for i list of static things
}
-
-
void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool interactiveInterface)
{
char tmp[255];
char tmpD[255];
-
FILE *pFile =fopen(fileNameContourROI.c_str(),"r+");
-
-
//CMRU 03-09-09- ----------------------------------------------------------------------------------------------
if(pFile != NULL)
{
fscanf(pFileData,"%s",tmpD); // NumberOfContours
fscanf(pFileData,"%s",tmpD); // #
}
-
fscanf(pFile,"%s",tmp); // --CreaContour--
-
fscanf(pFile,"%s",tmp); // Version
fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
std::string version(tmp);
-
-
-printf("EED wxContourMainFrame::onLoadContours version%s \n", version.c_str() );
-
-
//AD:02-06-09
_tmpReadFileTypeOfTransformation=-1;
if (version=="1.0.3")
openContours(pFile,pFileData,false);
openContours(pFile,pFileData,true); //Load StaticContours
}
-
if (version=="1.0.2")
{
//EED001
openContours(pFile,pFileData,true); // Load StaticContours
SetZForAllContours(-900);
}
-
//AD:02-06-09
else if (version=="1.0.1")
{
if(pFileData != NULL)
{
fclose(pFileData);
- }
+ } // if
}
_theViewPanel->getSceneManager()->removeSceneContours();
changeInstant();
}
-
-void wxContourMainFrame::onImport(){
+void wxContourMainFrame::onImport()
+{
std::string filename, filenamecontours;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog(NULL, _T("Choose a XML Osirix File"), _T(""), _T(""), _T("*.xml"), wxOPEN );
-
+#else
+ wxFileDialog dialog(NULL, _T("Choose a XML Osirix File"), _T(""), _T(""), _T("*.xml"), wxFD_OPEN );
+#endif
if (dialog.ShowModal() == wxID_OK)
{
filename = dialog.GetPath().mb_str();
if(filenamecontours.compare("") != 0){
onLoadContours(filenamecontours,true);
- }
-
- }
+ } // if
+ } // if
}
-void wxContourMainFrame::onTest(){
+
+void wxContourMainFrame::onTest()
+{
std::string filename, filenamecontours;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxOPEN );
+#else
+ wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxFD_OPEN );
+#endif
if (dialog.ShowModal() == wxID_OK)
{
filename = dialog.GetPath().mb_str();
std::cout << "This is the filename: " << filename << std::endl;
- }
+ } // if
}
if(GetFileLocation().empty())
{
//------------------------------------------------------------------------------------------------------------
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxSAVE );
+#else
+ wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxFD_SAVE );
+#endif
if (dialog.ShowModal() == wxID_OK)
{
std::string fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
}
-void wxContourMainFrame::RefreshInterface(){
+void wxContourMainFrame::RefreshInterface()
+{
changeInstant();
_theViewPanel->RefreshInterface();
//wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)this->_theViewPanel->getWxVtkBaseView();
//wxvtk2dbaseview->Refresh();
}
-vtkImageData* wxContourMainFrame::getImageData(){
+vtkImageData* wxContourMainFrame::getImageData()
+{
return _theViewPanel->getImageData();
}
vtkMarchingContourFilter* cntVTK = vtkMarchingContourFilter::New( );
- cntVTK->SetInput( idata );
-
cntVTK->SetNumberOfContours( 1 );
cntVTK->SetValue( 0, 255 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ cntVTK->SetInput( idata );
cntVTK->Update( );
cntVTK->UpdateInformation();
+#else
+ cntVTK->SetInputData( idata );
+#endif
vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cpd->SetInput( cntVTK->GetOutput( ) );
cpd->Update( );
cpd->UpdateInformation();
+#else
+ cpd->SetInputData( cntVTK->GetOutput( ) );
+#endif
+
vtkPolyDataConnectivityFilter* conn = vtkPolyDataConnectivityFilter::New( );
conn->SetExtractionModeToLargestRegion( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
conn->SetInput( cpd->GetOutput( ) );
conn->Update( );
conn->UpdateInformation();
+#else
+ conn->SetInputData( cpd->GetOutput( ) );
+#endif
+
vtkStripper* vtkstripper = vtkStripper::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkstripper->SetInput( conn->GetOutput() );
vtkstripper->Update();
vtkstripper->UpdateInformation();
+#else
+ vtkstripper->SetInputData( conn->GetOutput() );
+ cntVTK->Update();
+#endif
vtkPolyData* polyDataResult = cntVTK->GetOutput();
//std::cout<<"Points "<<polyDataResult->GetNumberOfPoints()<<std::endl;
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
polyDataResult->Update( );
polyDataResult->UpdateInformation();
+#else
+ // ..
+#endif
//EED
/*
{
vecXo.push_back(p[0]);
vecYo.push_back(p[1]);
- }
- else
- {
- vecX.push_back( p[0] );
- myfile <<p[0]<<","<<p[1]<<"\n";
- //std::cout<<" x Anterior "<<xAct<<" x actual "<<x<<std::endl;
- //std::cout<<" y Anterior "<<yAct<<" y actual "<<y<<std::endl;
- //std::cout<<" x "<<p[0]<<" y "<<p[1]<<std::endl;
- vecY.push_back( p[1] );
- vecZ.push_back( 900 );
- xAct=x;
- yAct=y;
- }
+ } else {
+ vecX.push_back( p[0] );
+ myfile <<p[0]<<","<<p[1]<<"\n";
+ //std::cout<<" x Anterior "<<xAct<<" x actual "<<x<<std::endl;
+ //std::cout<<" y Anterior "<<yAct<<" y actual "<<y<<std::endl;
+ //std::cout<<" x "<<p[0]<<" y "<<p[1]<<std::endl;
+ vecY.push_back( p[1] );
+ //EED 2017-12-16
+ vecZ.push_back( -900 );
+ xAct = x;
+ yAct = y;
+ } // if xAct
}
vecX.push_back(vecXo.back());
//std::cout<<" x Siguiente "<<vecXo.back();
vecXo.pop_back();
- vecZ.push_back( 900 );
+ //EED 2017-12-16
+ vecZ.push_back( -900 );
}
while(!vecYo.empty())
{
// y = y*spc[1];
// z = z*spc[3];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imageReslice->SetInput( imagedata );
+#else
+ imageReslice->SetInputData( imagedata );
+#endif
imageReslice->SetInformationInput(imagedata);
imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
imageReslice->SetResliceAxesOrigin(0,0,z);
imageReslice->SetOutputDimensionality(2);
imageReslice->SetInterpolationModeToLinear();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ imageReslice->Update();
+#endif
+
imagedata = imageReslice->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imagedata->Update();
imagedata->UpdateInformation();
+#else
+ // ..
+#endif
vtkContourFilter* cntVTK = vtkContourFilter::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cntVTK->SetInput( imagedata );
+#else
+ cntVTK->SetInputData( imagedata );
+#endif
cntVTK->SetNumberOfContours( 1 );
//cntVTK->SetValue( 0, vmin );
cntVTK->UpdateInformation();
vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cpd->SetInput( cntVTK->GetOutput( ) );
+#else
+ cpd->SetInputData( cntVTK->GetOutput( ) );
+#endif
cpd->ConvertLinesToPointsOff( );
cpd->Update( );
cpd->UpdateInformation();
conn->SetExtractionModeToClosestPointRegion( );
//conn->SetMaxRecursionDepth( 3000 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
conn->SetInput( cpd->GetOutput( ) );
+#else
+ conn->SetInputData( cpd->GetOutput( ) );
+#endif
conn->SetClosestPoint( x, y, 0 );
conn->Update( );
conn->UpdateInformation();
vtkCleanPolyData* cpd2 = vtkCleanPolyData::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cpd2->SetInput( conn->GetOutput( ) );
+#else
+ cpd2->SetInputData( conn->GetOutput( ) );
+#endif
cpd2->Update();
cpd2->UpdateInformation();
vtkStripper* vtkstripper = vtkStripper::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkstripper->SetInput( cpd2->GetOutput() );
+#else
+ vtkstripper->SetInputData( cpd2->GetOutput() );
+#endif
vtkstripper->Update();
vtkstripper->UpdateInformation();
vtkPolyData* polyDataResult = vtkstripper->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
polyDataResult->Update( );
polyDataResult->UpdateInformation();
+#else
+ //...
+#endif
/* EED
ofstream myfile;
// double y=p[1];
vecX.push_back( p[0] );
vecY.push_back( p[1] );
- vecZ.push_back( 900 );
+ //EED 2017-12-16
+ vecZ.push_back( -900 );
// vecZ.push_back( p[2] );
}
return _theViewPanel->getWindowLevel();
}
-void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
+void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
+{
_theViewPanel->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
RefreshInterface();
}
-void wxContourMainFrame::onInterpolation(bool interpolate){
+void wxContourMainFrame::onInterpolation(bool interpolate)
+{
_theViewPanel->onInterpolation(interpolate);
RefreshInterface();
}
-void wxContourMainFrame::onChangeInstant(std::string name,int actual){
+void wxContourMainFrame::onChangeInstant(std::string name,int actual)
+{
_instantPanel->setConceptValue( name, actual );
}
-void wxContourMainFrame::resetAppend(){
+void wxContourMainFrame::resetAppend()
+{
kernelManager->resetAppend();
-
}
-void wxContourMainFrame::onSpreadAdd(){
+void wxContourMainFrame::onSpreadAdd()
+{
std::vector<double> vecX;
std::vector<double> vecY;
std::vector<double> vecZ;
}
-void wxContourMainFrame::onSpreadAddAll(){
+void wxContourMainFrame::onSpreadAddAll()
+{
//EED02
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
}
-void wxContourMainFrame::onSpreadGo(int type){
+void wxContourMainFrame::onSpreadGo(int type)
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
//RefreshInterface();
}
-void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector){
-
+void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector)
+{
}
-std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide){
+std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide)
+{
std::vector<int> tempVector;
_instantPanel->getInstant(tempVector);
//Asignation of slide number should be different ex by name
int z;
int ii,sizeLstContourThings;
-
double totalZ;
double porcent;
}
- void wxContourMainFrame::SaveImageResult(std::string directory,std::string namefile, vtkImageData* mask,vtkImageData* value)
+ std::string wxContourMainFrame::GetStringTypeImage( vtkImageData* image)
{
+ std::string result="";
+ if ( image->GetScalarType()==VTK_CHAR )
+ {
+ result="CHAR";
+ } else if ( image->GetScalarType()==VTK_UNSIGNED_CHAR ){
+ result="UCHAR";
+ } else if ( image->GetScalarType()==VTK_FLOAT ){
+ result="FLOAT";
+ } else if ( image->GetScalarType()==VTK_DOUBLE ){
+ result="DOUBLE";
+ } else if ( image->GetScalarType()==VTK_INT ){
+ result="INT";
+ } else if ( image->GetScalarType()==VTK_UNSIGNED_INT ){
+ result="UINT";
+ } else if ( image->GetScalarType()==VTK_SHORT ){
+ result="SHORT";
+ } else if ( image->GetScalarType()==VTK_UNSIGNED_SHORT ){
+ result="USHORT";
+ } else if ( image->GetScalarType()==VTK_LONG ){
+ result="LONG";
+ } else if ( image->GetScalarType()==VTK_UNSIGNED_LONG ){
+ result="ULONG";
+ }
+ return result;
+ }
+ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namefile, vtkImageData* mask,vtkImageData* value)
+ {
+ std::string stringType;
double spc[3];
kernelManager->GetSpacing(spc,0); // returns the spacing of the first image
-
- std::string temp = directory + "/" + namefile + "-image-Value.mhd";
+ stringType = GetStringTypeImage(value);
+ std::string temp = directory + "/" + namefile + "-image-Value-"+stringType+".mhd";
wxString filename = crea::std2wx(temp);
// Image Value
vtkImageChangeInformation *valueChInfo = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
valueChInfo->SetInput(value);
+#else
+ valueChInfo->SetInputData(value);
+#endif
valueChInfo->SetSpacingScale(spc);
vtkMetaImageWriter *writerValueImage = vtkMetaImageWriter::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writerValueImage->SetInput( valueChInfo->GetOutput() );
+#else
+ writerValueImage->SetInputData( valueChInfo->GetOutput() );
+#endif
writerValueImage->SetFileName( (const char *)filename.mb_str() );
writerValueImage->SetFileDimensionality( 3 );
writerValueImage->SetCompression(false);
writerValueImage->Write( );
// Image Mask
- temp = directory + "/" + namefile + "-image-Mask.mhd";
+ stringType = GetStringTypeImage(mask);
+ temp = directory + "/" + namefile + "-image-Mask-"+stringType+".mhd";
// LG 14/01/09 : using crea
filename = crea::std2wx(temp);
vtkImageChangeInformation *maskChInfo = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
maskChInfo->SetInput(mask);
+#else
+ maskChInfo->SetInputData(mask);
+#endif
maskChInfo->SetSpacingScale(spc);
vtkMetaImageWriter *writerMaskImage = vtkMetaImageWriter::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writerMaskImage->SetInput( maskChInfo->GetOutput() );
+#else
+ writerMaskImage->SetInputData( maskChInfo->GetOutput() );
+#endif
+
writerMaskImage->SetFileName( (const char *)filename.mb_str() );
writerMaskImage->SetFileDimensionality( 3 );
writerMaskImage->SetCompression(false);
wxPanel *wxContourMainFrame::getMaskImageViewPanel(wxWindow *parent)
{
-
+
if (_viewMaskImagePanel==NULL)
{
_contourextractdata = new ContourExtractData(true);
// _theViewPanel->getImageData()->GetScalarRange(range);
//int min = (int)floor (range[0]);
//int max = (int)ceil (range[1]);
+
+ //EED 2017-12-17
int min = 254;
int max = 256;
- _viewMaskImagePanel = new ThresholdImageViewPanel( parent, -1, -1 , 0);
+
+ _viewMaskImagePanel = new ThresholdImageViewPanel( parent, -1, -1 , -1,-1, 0);
_viewMaskImage = new ThresholdImageView();
- _viewMaskImage->SetImage(_contourextractdata->GetVtkImageMaskResult() );
+ _viewMaskImage->SetImage( _contourextractdata->GetVtkImageMaskResult() );
_viewMaskImage->SetminMaxValue( min, max);
_viewMaskImage->SetBaseColor( 0,0,1 );
+
+
+ std::vector<int> colorbarposition;
+ colorbarposition.push_back( -999 );
+ colorbarposition.push_back( -999 );
+ _viewMaskImage->SetColorBarPosition( colorbarposition );
+ double spc[3];
+ _viewMaskImage->SetSpcBase( _theViewPanel->getImageData()->GetSpacing() );
+ _viewMaskImage->SetNewSpacingLayer( _theViewPanel->getImageData()->GetSpacing() );
+
_viewMaskImagePanel->SetThresholdImageView( _viewMaskImage );
_viewMaskImage->SetwxVtkBaseView( _theViewPanel->getWxVtkBaseView() );
+ _viewMaskImage->onThresholdChangeOpacity( 25 );
}
return _viewMaskImagePanel;
}
int max = (int)ceil (range[1]);
_viewColorLayerImagePanel = new ColorLayerImageViewPanel( parent, min, max, 100, 1);
_viewColorLayerImagePanel->GetColorLayerImageViewManager()->SetwxVtkBaseView( 0 , _theViewPanel->getWxVtkBaseView() );
+ // std::vector<double> range = bbGetInputlstRangeForColorBar();
+ // clivp->GetColorLayerImageViewManager()->SetRangeForColorBar( range );
+ std::vector<int> colorbarposition;
+ colorbarposition.push_back( 50 );
+ colorbarposition.push_back( 105 );
+ _viewColorLayerImagePanel->GetColorLayerImageViewManager()->SetColorBarPosition( colorbarposition );
+ // std::vector<double> base_color;
+ // _viewColorLayerImagePanel->GetColorLayerImageViewManager()->SetBaseColors( base_color );
+ // std::vector<double> grey_level_boundaries;
+ // clivp->GetColorLayerImageViewManager()->SetGreyLevelBoundaries( grey_level_boundaries );
+ std::vector<double> transparence_level_boundaries;
+ transparence_level_boundaries.push_back(0);
+ _viewColorLayerImagePanel->GetColorLayerImageViewManager()->SetBaseTransparence( transparence_level_boundaries );
+ _viewColorLayerImagePanel->GetColorLayerImageViewManager()->SetPlainOrGradientColor( false );
+ // _viewColorLayerImagePanel->SetFittingMode( 3 );
}
return _viewColorLayerImagePanel;
}
_theViewPanel->getImageData()->GetScalarRange(range);
int min = (int)floor (range[0]);
int max = (int)ceil (range[1]);
- _viewThresholdImagePanel = new ThresholdImageViewPanel( parent, min, max , 1);
+ int start= (max+min)/2 - (max-min)*0.25;
+ int end= (max+min)/2 + (max-min)*0.25;
+ _viewThresholdImagePanel = new ThresholdImageViewPanel( parent, min, max, start, end , 1);
_viewThresholdImage = new ThresholdImageView();
+ _viewThresholdImage->SetminMaxValue(start,end);
_viewThresholdImage->SetImage( _theViewPanel->getImageData() );
- _viewThresholdImage->SetminMaxValue( min, max);
+ std::vector<int> colorbarposition;
+ colorbarposition.push_back( 10 );
+ colorbarposition.push_back( 105 );
+ _viewThresholdImage->SetColorBarPosition( colorbarposition );
+ double spc[3];
+ _viewThresholdImage->SetSpcBase( _theViewPanel->getImageData()->GetSpacing() );
+ _viewThresholdImage->SetNewSpacingLayer( _theViewPanel->getImageData()->GetSpacing() );
+
_viewThresholdImage->SetBaseColor( 1,0,0 );
_viewThresholdImagePanel->SetThresholdImageView( _viewThresholdImage );
_viewThresholdImage->SetwxVtkBaseView( _theViewPanel->getWxVtkBaseView() );
+ _viewThresholdImage->onThresholdChangeOpacity( 25 );
+ RefreshInterface();
}
return _viewThresholdImagePanel;
}
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
#include "vtkMetaImageWriter.h"
#include "vtkImageData.h"
#include "vtkTransform.h"
-
#include "vtkCamera.h"
#include "vtkImageActor.h"
#include <vtkImageMapToColors.h>
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-----------------------------------------------------------------------------------------------
/**
void SetScalarRange(int grayRangeMin, int grayRangeMax);
+ std::string GetStringTypeImage( vtkImageData* image);
+
//------------------------------------------------------------------------------------------------------------
private:
int _numberOfVariablesStatistics;
// Contour Image Mask
- ThresholdImageView *_viewMaskImage;
+ ThresholdImageView *_viewMaskImage;
ThresholdImageViewPanel *_viewMaskImagePanel;
// Threshold Image
std::string _fileLocation;
//------------------------------------------------------------------------------------------------------------
+ wxFrame *_frameShowResultImages;
+
};
#endif
//------------------------------------------------------------------------------------------------------------
// Constructors & Destructors
//------------------------------------------------------------------------------------------------------------
- /*{
-
- showingVID = theShowingImage;
- int gapH = 20;
- int gapV = 10;
- createHorizontalBar(1,80);
- createVerticalBar(1,200);
- createViewPanel();
-
- wxFlexGridSizer * panelSizer = new wxFlexGridSizer(3,1,0,0);
- panelSizer->AddSpacer(gapV);
- panelSizer -> AddGrowableCol(1);
- panelSizer->Add(theViewPanel, 1, wxEXPAND);
- panelSizer->AddSpacer(gapV);
-
- wxFlexGridSizer * downSizer = new wxFlexGridSizer(1,3,gapV,gapH);
- downSizer->Add(_verticalBar, 1, wxEXPAND);
- //downSizer->AddSpacer(gapH);
- downSizer -> AddGrowableCol(1);
- downSizer->Add(panelSizer, 1, wxEXPAND|wxALL|wxCENTER);
- //downSizer->AddSpacer(gapH);
- outSizer = new wxFlexGridSizer(3,1,1,1);
- outSizer->Add(_horizontalBar, 1, wxEXPAND);
- outSizer -> AddGrowableRow(1);
- outSizer -> AddGrowableCol(1);
- outSizer->Add(downSizer, 1, wxEXPAND);
-
- _horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + gapH, gapV);
- _horizontalBar->setDeviceEndMargin( 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(_horizontalBar->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onStartChange_Bar_Horizontal );
- Connect(_horizontalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onEndChange_Bar_Horizontal );
- Connect(_horizontalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onSelectionEnd_Horizontal );
- Connect(_horizontalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onMovedBar_Horizontal );
-
- //Connecting the events to the vertical bar
- Connect(_verticalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Vertical );
- Connect(_verticalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onActualChange_Bar_Vertical );
- Connect(_verticalBar->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onStartChange_Bar_Vertical );
- Connect(_verticalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onEndChange_Bar_Vertical );
- Connect(_verticalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onSelectionEnd_Vertical );
- Connect(_verticalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onMovedBar_Vertical );
-
-
- this->SetAutoLayout( true );
- SetSizer( outSizer );
- this->Layout();
-
- SetSize(900,700);
- theViewPanel->SetSize(800,600);
- theViewPanel->GetWindow(1)->SetSize(800,600);
-
- outSizer->Fit( this );
- SetBackgroundColour(wxColour(255,0,0));
-
- }*/
//:wxScrolledWindow(parent, -1, pos, size, style)
- wxContourViewPanel :: wxContourViewPanel ( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
+ wxContourViewPanel::wxContourViewPanel ( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
:wxPanel(parent, -1, pos, size, style)
{
theShowingImage->GetSpacing(last_spacing);
- showingVID = theShowingImage;
- int gapH = 20;
- int gapV = 10;
- _verticalConceptName = "";
- _horizontalConceptName = "";
+ showingVID = theShowingImage;
+ int gapH = 20;
+ int gapV = 10;
+ _verticalConceptName = "";
+ _horizontalConceptName = "";
createHorizontalBar(1,80);
createVerticalBar(1,200);
createViewPanel();
- _eventHandler = NULL;
-
- wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1, 4, gapV, gapH);
+ _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 -> AddGrowableCol(2);
panelSizer -> AddGrowableRow(2);
- panelSizer->Add(_verticalBar, 1, wxGROW);
+#else
+ panelSizer -> AddGrowableRow(0,1);
+ panelSizer -> AddGrowableCol(2,1);
+#endif
+ panelSizer->Add(_verticalBar, 0, wxEXPAND);
panelSizer->AddSpacer(gapV);
- panelSizer->Add(theViewPanel, 1, wxGROW);
+ 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 -> AddGrowableCol(1);
outSizer -> AddGrowableRow(1);
- outSizer->Add( _horizontalBar, 1, wxGROW);
- outSizer->Add( panelSizer, 1, wxGROW);
+#else
+ outSizer -> AddGrowableRow(1,1);
+ outSizer -> AddGrowableCol(0,1);
+#endif
+ 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(_verticalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onEndChange_Bar_Vertical );
Connect(_verticalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onSelectionEnd_Vertical );
Connect(_verticalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onMovedBar_Vertical );
-
-
this->SetSizer( outSizer );
this->SetAutoLayout( true );
this->Layout();
-
//SetSize(1900,1900);
//theViewPanel->SetSize(800,600);
//theViewPanel->GetWindow(1)->SetSize(800,600);
-
//outSizer->Fit( this );
-
initializeScenceManager();
}
delete _sceneManager;
}
- void wxContourViewPanel::initializeScenceManager(){
-
+ void wxContourViewPanel::initializeScenceManager()
+ {
//_theViewPanel = theViewPanel;
//_theViewPanel->setWxEventHandler( this );
-
double spc[3];
this->getSpacing(spc);
_sceneManager = new wxVtkBaseView_SceneManager ( this->getWxVtkBaseView(), this, spc );
-
Connect( this->GetId(), wxINSTANT_CHANGE, (wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onChangeInstant );
Connect( wxID_ANY, wxEVT_START_CREATE_MULT_ROI, (wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onCreateMultipleROI );
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;
}
}
}
- void wxContourViewPanel::removeSceneContours(){
+ void wxContourViewPanel::removeSceneContours()
+ {
_sceneManager->removeSceneContours();
}
- void wxContourViewPanel::addNameWrapperToScene(){
+ void wxContourViewPanel::addNameWrapperToScene()
+ {
int size = wxContourMainFrame::getInstance()->getNamesWrappingSize();
for(int i = 0; i < size;i++){
std::string name = wxContourMainFrame::getInstance()->getNameWrapping(i);
void wxContourViewPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
{
wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)getWxVtkBaseView();
- vtkImageViewer2 *imageviewer = wxvtk2dbaseview->_imageViewer2XYZ->GetVtkImageViewer2();
- imageviewer->SetColorWindow(colorwindow);
- imageviewer->SetColorLevel(windowlevel);
+ wxvtk2dbaseview->SetColorWindow( colorwindow );
+ wxvtk2dbaseview->SetColorLevel( windowlevel );
}
void wxContourViewPanel::onInterpolation(bool interpolate)
{
wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)getWxVtkBaseView();
- vtkImageViewer2 *imageviewer = wxvtk2dbaseview->_imageViewer2XYZ->GetVtkImageViewer2();
-
- if (interpolate){
- imageviewer->GetImageActor()->InterpolateOn();
- } else {
- imageviewer->GetImageActor()->InterpolateOff();
- }
+ wxvtk2dbaseview->SetInterpolate( interpolate );
}
void wxContourViewPanel::GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ )