IF(WIN32)
#MESSAGE("WIN32")
ADD_EXECUTABLE(creaContourApp WIN32 wxContourGUIExample.cxx)
- SET_TARGET_PROPERTIES(creaContourApp PROPERTIES LINK_FLAGS /subsystem:console )
+
+ IF(MINGW)
+ SET_TARGET_PROPERTIES(creaContourApp PROPERTIES LINK_FLAGS -mconsole )
+ ELSE(MINGW)
+ SET_TARGET_PROPERTIES(creaContourApp PROPERTIES LINK_FLAGS /subsystem:console )
+ ENDIF(MINGW)
+
+
ELSE(WIN32)
ADD_EXECUTABLE(creaContourApp MACOSX_BUNDLE wxContourGUIExample)
ENDIF(WIN32)
)
INSTALL_TARGETS(/bin/ creaContourApp )
+
+
+
+
+
+
#include "wxContourMainFrame.h"
//#include "OutlineModelManager.h"
//#include "wxContourEventHandler.h"
-
//#include <creaImageIOWxGimmickDialog.h>
//#include <creaImageIOWxGimmickReaderDialog.h>
#include <creaImageIOWxSimpleDlg.h>
-
#include <creaImageIOSystem.h>
-
#include <creaVtkBasicSlicer.h>
//#include "wxContourMainPanel.h"
-
#include "vtkMetaImageReader.h"
#include <map>
#include "vtkImageData.h"
-
#include "wx/artprov.h"
#include <wx/filedlg.h>
-
-/* EED EraseMe
-//#include "OutlineModelBuilder.h"
-//#include "ContourThing.h"
-//#include "AxeThing.h"
-//#include "ImageSourceThing.h"
-//#include "ImageSectionThing.h"
-//#include "SomeEnvironment.h"
-//#include "ReaderEnvironment.h"
-
-//#include "interfMainPanel.h"
-
-#if defined(MACOSX) // assume this is OSX
-# include <sys/param.h>
-# include <mach-o/dyld.h> // _NSGetExecutablePath : must add -framework CoreFoundation to link line
-# include <string.h>
-# ifndef PATH_MAX
-# define PATH_MAX MAXPATHLEN
-# endif
-#endif // MACOSX
-*/
-
#ifndef PATH_MAX // If not defined yet : do it
# define PATH_MAX 2048
#endif
-
#if defined(WIN32)
#include <direct.h>
#else
#include <dirent.h>
#endif
-
#include <stdlib.h>
-
-
wxContourMainFrame* wxTheApplication::frame = 0;
//----------------------------------------------------------------------------------------------------------------
// This macro implements the entry point (main function) for the application
//----------------------------------------------------------------------------------------------------------------
-
-
-
-
-
//=========================================================================
//=========================================================================
IMPLEMENT_APP( wxTheApplication );
}
#endif
-
-
-bool wxTheApplication :: OnInit()
+bool wxTheApplication::OnInit()
{
vtkOutputWindowCreaContour *outputWindowCreaContour= vtkOutputWindowCreaContour::New();
vtkOutputWindow::SetInstance( outputWindowCreaContour );
outputWindowCreaContour->Delete();
-
wxString infoImage;
wxInitAllImageHandlers();
//EED01Juin2010 int output_dim = NATIVE;
//EED01Juin2010 int threads = 1;
-
//EED 1Juin2010
creaImageIO::WxSimpleDlg w(0,_T("Select your image"),"creaContours_Descriptor.dscp","creatisContours DB");
w.ShowModal();
// threads);
// w.ShowModal();
-
//JCP
//std::string datadir( crea::wx2std(GetExecutablePath()) );
std::string datadir( crea::System::GetExecutablePath() );
//JCP
-
#ifdef LINUX /* assume this is OSX */
datadir=datadir+"/../share/creaContours";
#endif // MACOSX
-
#ifdef MACOSX /* assume this is OSX */
datadir=datadir+"/../../../../share/creaContours";
#endif // MACOSX
-
-
if(w.GetReturnCode() == wxID_OK)
{
- std::vector<std::string> s;
-//EED 01Juin2010 w.GetSelectedFiles(s);
-
-
-//EED std::vector<std::string>::iterator i;
-// for (i=s.begin();i!=s.end();++i)
-// {
-// std::cout << *i << std::endl;
-// }
-// std::cout << "$$$$ "<<std::endl;
- //w.GetSelectedImages(images);
-
-//EED31mai2010 w.GetSelectedImages(images,output_dim);
-
-
-//EED 1Juin2010
-// std::vector<creaImageIO::OutStrGimmick> out;
-// std::vector<std::string> attr;
-//// attr.push_back("D0028_0010");
-//// attr.push_back("D0008_0023");
-//// attr.push_back("D0008_1070");
-// w.getSelected(out, attr,true,"");
-//// std::cout<<out.size()<<std::endl;
-//// crea::VtkBasicSlicer(out.front().img);
-// int size=out.size();
-// int ii;
-// for (ii=0;ii<size;ii++)
-// {
-// images.push_back(out[ii].img);
-// }
-
-//EED 1Juin2010
-// printf("EED creaContours wxTheApplication :: OnInit %d\n", w.getImagesSelected().size() );
- images = w.getImagesSelected();
- infoImage = w.getInfoImage();
-// printf("EED creaContours wxTheApplication :: OnInit %d\n", images.size() );
-
- }
- else if (w.GetReturnCode() == wxID_CANCEL)
+ std::vector<std::string> s;
+ images = w.getImagesSelected();
+ infoImage = w.getInfoImage();
+ } else if (w.GetReturnCode() == wxID_CANCEL)
{
- vtkMetaImageReader *reader = vtkMetaImageReader::New();
- std::string filename= datadir + "/data/hola.mhd";
- infoImage=_T("DEFAULT-Image:")+crea::std2wx(filename);
- reader->SetFileName( filename.c_str() );
- reader->Update();
- images.push_back(reader->GetOutput());
- }
- else
- {
- return -1;
- }
-
-
+ vtkMetaImageReader *reader = vtkMetaImageReader::New();
+ std::string filename= datadir + "/data/hola.mhd";
+ infoImage=_T("DEFAULT-Image:")+crea::std2wx(filename);
+ reader->SetFileName( filename.c_str() );
+ reader->Update();
+ images.push_back(reader->GetOutput());
+ } else {
+ return -1;
+ }
wxFrame* frame1 = new wxFrame(NULL, wxID_ANY, wxT("Creatis- ROI Application- Evaluation version,01 Agost 2010 ")+infoImage, wxPoint(400,50), wxSize(800, 600) );
-
//frame = new wxContourMainFrame( frame1, wxID_ANY, wxString(_T("")), wxPoint(50,50), wxSize(800, 600), images );
frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(200,50), wxSize(800, 600), images, wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
frame1->CreateStatusBar();
#if(WIN32)
int main(int argc, char* argv[])
- {
- return WinMain(::GetModuleHandle(NULL), NULL,
- ::GetCommandLine(), SW_SHOWNORMAL);
+ {
+ char buffer[500];
+ wcstombs(buffer, ::GetCommandLine(), 500);
+ return WinMain(::GetModuleHandle(NULL), NULL, buffer, SW_SHOWNORMAL);
+// return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
}
#else
#endif
#===========================================================================
# PACKAGE AUTHOR
# !!! NO COMMA ALLOWED !!!
-SET(${BBTK_PACKAGE_NAME}_AUTHOR "InfoTeam CREATIS-LRMN")
+SET(${BBTK_PACKAGE_NAME}_AUTHOR "InfoTeam CREATIS")
#===========================================================================
#===========================================================================
vtkImageData* img = bbGetInputIn();
std::vector<vtkImageData*> selectedimages;
- if(img!=NULL && currentimg!=img){
-
- printf("EED nDimensions::Process 02\n");
+ if(img!=NULL && currentimg!=img)
+ {
wxContourMainFrame::getInstance()->ShowToolsPanel(true);
currentimg=img;
selectedimages.push_back(img);
wxContourMainFrame::getInstance()->setVectImages(selectedimages);
- printf("EED nDimensions::Process 03\n");
}
if(currentimg != NULL){
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)
#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()
{
// 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");
// 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 );
-// infoWin->SetAutoLayout( true );
+ infoWin->SetAutoLayout( true );
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()
};
/* // 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);
//: 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, 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 );
- sizer->Add( sizerB , 1, wxALL|wxGROW , 0 );
- sizer->Add( _staticTextInformation , 1, wxALL|wxGROW , 0 );
+
+
+ sizer->Add( sizerB , 1, wxEXPAND , 0 );
+ sizer->Add( _staticTextInformation , 1, wxEXPAND , 0 );
sizer->Add( _grid , 1, wxEXPAND , 0 );
-
this->SetSizer( sizer );
-// this->SetSize( wxSize(1500,1500) );
-// this->SetBackgroundColour( wxColour(100,100,100) );
+ this->SetSize( wxSize(1500,1500) );
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 );
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);
// Constructors & Destructors
//------------------------------------------------------------------------------------------------------------
- wxConceptControl :: wxConceptControl(wxWindow *parent, bool orientation, int minV, int maxV, int actualV, std::string &aConceptName, std::string elementsDef )
+ wxConceptControl::wxConceptControl(wxWindow *parent, bool orientation, int minV, int maxV, int actualV, std::string &aConceptName, std::string elementsDef )
:wxPanel(parent, -1, wxDefaultPosition, parent->GetSize(), wxTAB_TRAVERSAL)
{
-
- minValue = minV;
- maxValue = maxV;
- _numCheckBox = 0;
-
- showLabels = true;
-
- wxFlexGridSizer* sizer = new wxFlexGridSizer (1, 3, 15, 15);
-
+ minValue = minV;
+ maxValue = maxV;
+ _numCheckBox = 0;
+ showLabels = true;
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ wxFlexGridSizer* sizer = new wxFlexGridSizer(1, 3, 15, 15);
+#else
+ wxFlexGridSizer* sizer = new wxFlexGridSizer(3);
+#endif
conceptName = new wxStaticText(this, -1, wxString(aConceptName.c_str(),wxConvUTF8), wxDefaultPosition, wxSize(90,20), wxALIGN_CENTRE );
sizer->Add( conceptName, 0, wxALIGN_CENTRE |wxALIGN_CENTER_HORIZONTAL);
-
if(orientation)
{
sizer->AddGrowableCol(1);
conceptSlider = new wxSlider(this, -1, actualV, minV, maxV, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL| wxSL_AUTOTICKS | wxSL_LABELS, wxDefaultValidator, wxString(aConceptName.c_str(),wxConvUTF8));
- }
- else
- {
- sizer->AddGrowableRow(1);
+ } else {
+// sizer->AddGrowableRow(1);
conceptSlider = new wxSlider(this, -1, actualV, minV, maxV, wxDefaultPosition, wxDefaultSize, wxSL_LEFT| wxSL_AUTOTICKS | wxSL_LABELS, wxDefaultValidator, wxString(aConceptName.c_str(),wxConvUTF8) );
}
sizer->Add(conceptSlider, 0, wxGROW |wxALL );
createElements( sizer, elementsDef );
SetSizer( sizer );
-
Connect( conceptSlider->GetId(), wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(wxConceptControl::onSliderTrack));//(wxObjectEventFunction) &wxConceptControl :: onSliderRelease );
Connect( conceptSlider->GetId(), wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(wxConceptControl::onSliderRelease));//(wxObjectEventFunction) &wxConceptControl :: onSliderTrack );
-
this->SetAutoLayout( true );
this->Layout();
}
//------------------------------------------------------------------------------------------------------------
// Creational and initialization methods
//------------------------------------------------------------------------------------------------------------
- void wxConceptControl :: createElements(wxSizer *sizer , std::string elementsDef )
+ void wxConceptControl::createElements(wxSizer *sizer , std::string elementsDef )
{
const char * elements = elementsDef.c_str();
int elementsNum = elementsDef.size();
- wxFlexGridSizer* checkSizer = new wxFlexGridSizer (1, elementsNum, 5, 5);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ wxFlexGridSizer* checkSizer = new wxFlexGridSizer(1, elementsNum, 5, 5);
+#else
+ wxFlexGridSizer* checkSizer = new wxFlexGridSizer(elementsNum);
+#endif
int i,ckecks = 0;
for( i = 0;*elements!= 0; elements++)
{
}*/
createCheckBoxAndAddToSizer( checkSizer, "X", -1, ckecks);
ckecks++;
- }
- else if ( a == 84 || a==116 )// Including T:84 or t t:116 as textCtrl (ASCII)
+ } else if ( a == 84 || a==116 )// Including T:84 or t t:116 as textCtrl (ASCII)
{
}
// _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);
inredo = 0;
inundo = 0;
_pannew = interfMainPanel::getInstance(this,datadir+"/data/Icons");//, eventHandler);
- _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 );
}
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
/*
// 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;
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
// 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);
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);
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-----------------------------------------------------------------------------------------------
/**
int _numberOfVariablesStatistics;
// Contour Image Mask
- ThresholdImageView *_viewMaskImage;
+ ThresholdImageView *_viewMaskImage;
ThresholdImageViewPanel *_viewMaskImagePanel;
// Threshold Image
//------------------------------------------------------------------------------------------------------------
// 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);
// 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
*/
//------------------------------------------------------------------------------------------------------------
// Attributtes
//------------------------------------------------------------------------------------------------------------
- wxVtkBaseView_SceneManager* _sceneManager;
+ wxVtkBaseView_SceneManager *_sceneManager;
/*
* Represents the outer sizer of the ContourViewPanel
*/
- wxFlexGridSizer* outSizer;
+ wxFlexGridSizer *outSizer;
/*
* Represents the panel for viewing
*/
- wxMaracas_N_ViewersWidget * theViewPanel;
+ wxMaracas_N_ViewersWidget *theViewPanel;
/*
* Represents the vertical barrange
*/
- mBarRange * _verticalBar;
+ mBarRange *_verticalBar;
/*
* Represents the horizontal barrange
*/
- mBarRange * _horizontalBar;
-
- vtkImageData * showingVID;
-
- std::string _verticalConceptName;
+ mBarRange *_horizontalBar;
+ vtkImageData *showingVID;
+ std::string _verticalConceptName;
+ std::string _horizontalConceptName;
+ double last_spacing[3];
+ bool _useVerticalBar;
+ bool _useHorizontalBar;
- std::string _horizontalConceptName;
-
- double last_spacing[3];
-
- bool _useVerticalBar;
-
- bool _useHorizontalBar;
-
- wxEvtHandler * _eventHandler;
+ wxEvtHandler *_eventHandler;
//EED
setVerticalMaxSelectedNums( groupConfig );
SetSize(size);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_outSizer = new wxFlexGridSizer ( 1, 10, 10);
+#else
+ _outSizer = new wxFlexGridSizer ( 10);
+#endif
_orientation = theOrientation;
initializeResolutionSlider();
_actualInstant=new std::map<std::string,int>();
//------------------------------------------------------------------------------------------------------------
void wxInstantChooserPanel :: onResolutionSlider(wxScrollEvent& event)
{
- std::string lasConcept = _lastConceptUpdated->getName();
- int value = _lastConceptUpdated->getActualValue();
- int min = _lastConceptUpdated->getMinValue();
- int max = _lastConceptUpdated->getMaxValue();
- int delta = (int) (pow((double) 2, _resolutionSlider->GetValue() ));
- int minTmp = value - delta/2;
- int maxTmp = value + delta/2;
+ std::string lasConcept = _lastConceptUpdated->getName();
+ int value = _lastConceptUpdated->getActualValue();
+ int min = _lastConceptUpdated->getMinValue();
+ int max = _lastConceptUpdated->getMaxValue();
+ int delta = (int) (pow((double) 2, _resolutionSlider->GetValue() ));
+ int minTmp = value - delta/2;
+ int maxTmp = value + delta/2;
if (minTmp<min)
{
minTmp = min;
wxVtkBaseView_SceneManager :: wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc )
{
-
_lastInteraction = NULL;
- _lastInteractionName = "";
+ _lastInteractionName = "";
_eventHandler = theEventHandler;
_leftClickCount = 0;
_rigthClickCount = 0;
-
- _contours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
- _sceneContours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
+ _contours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
+ _sceneContours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
_workingGroup = new std::map< std::string, ContourWrap_ViewControl * >();
-
_creatingMULT_ROI = false;
- _editingROI = false;
- _toIncludeAtInteractionGroup = false;
- _waiting = false;
+ _editingROI = false;
+ _toIncludeAtInteractionGroup = false;
+ _waiting = false;
_creatingROI = false;
- _drawingSelectionROI = false;
- SetWidthContour(1.0);
-
+ _drawingSelectionROI = false;
+ SetWidthContour(1.0);
_wxVtk_BaseView = theWxBaseViewToManage;
if( _wxVtk_BaseView!=NULL )
{
}
configureSelectionROI( spc );
}
+
//------------------------------------------------------------------------------------------------------------
wxVtkBaseView_SceneManager :: ~wxVtkBaseView_SceneManager()
{
{
_contours_ViewControl->erase( iter );
i++;
- }
+ } // for
_contours_ViewControl->clear();
delete _contours_ViewControl;
_workingGroup->clear();
wxCommandEvent cevent( theEventType );
cevent.SetString( wxString( text.c_str(), wxConvUTF8) );
_eventHandler->ProcessEvent( cevent );
- }
+ } // if
}
-
//------------------------------------------------------------------------------------------------------------
// Attributes getters and setters
//------------------------------------------------------------------------------------------------------------
{
_eventHandler = theEventHandler;
}
+
//------------------------------------------------------------------------------------------------------------
void wxVtkBaseView_SceneManager :: setWxVtkViewBase( wxVtkBaseView * theBaseView )
{
{
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( )
{
}
//------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: removeSceneContours( )
+ void wxVtkBaseView_SceneManager::removeSceneContours()
{
std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin();
int size = _sceneContours_ViewControl->size();
iter++;
}
_sceneContours_ViewControl->clear();
-
-
//Removing the selection rectangle to avoid showing when it's innecesary
_controlerSelectionROI->SetActive( false );
_viewerSelectionROI->RemoveCompleteContourActor();
bool condition = true;
int X,Y;
- wxVTKRenderWindowInteractor *_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
bool ctrlKey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey() == 1;
size = selectionSize;
iter = _workingGroup->begin();
}
- }
- else
- {
+ } else {
_toIncludeAtInteractionGroup = false;
}
double sg = (double)(start) / CLOCKS_PER_SEC;
#endif
int tmpPx,tmpPy;
- wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition( tmpPx , tmpPy );
fprintf(ff,"::%s (x,y) = (%i, %i) t(sg): %f\n \n",method.c_str(), tmpPx, tmpPy, sg);
fclose(ff);
int GetImageDataSizeZ();
void GetImageDataRange( double *range );
- void SetWidthContour(double width);
+ void SetWidthContour(double width);
//JCP 21 - 09 - 08
bool isEditableCControler(std::string theKeyName);
// Attributtes
//------------------------------------------------------------------------------------------------------------
- std::map<std::string, ContourWrap_ViewControl *> * _contours_ViewControl;
- std::map<std::string, ContourWrap_ViewControl *> * _sceneContours_ViewControl;
- wxVtkBaseView *_wxVtk_BaseView;
- wxEvtHandler *_eventHandler;
- ContourWrap_ViewControl *_lastInteraction;
- std::string _lastInteractionName;
- std::map<std::string, ContourWrap_ViewControl *> * _workingGroup;
- bool _creatingMULT_ROI;
- bool _editingROI;
- bool _toIncludeAtInteractionGroup;
- bool _waiting;
- bool _creatingROI;
- int _enventID;
- int _leftClickCount;
- int _rigthClickCount;
- int clickX;
- int clickY;
- char _lastKeyCode;
- long int onCharCallBackTimeEnd;
- long int onCharNeeded;
- bool _drawingSelectionROI;
- manualRoiControler *_controlerSelectionROI;
- manualViewRoi *_viewerSelectionROI;
- manualBaseModel *_modelSelectionROI;
- double _widthOfContour;
- double _widthOfControlPoint;
-
- bool _ctrlKey;
- bool _shiftKey;
+ std::map<std::string, ContourWrap_ViewControl *> *_contours_ViewControl;
+ std::map<std::string, ContourWrap_ViewControl *> *_sceneContours_ViewControl;
+ wxVtkBaseView *_wxVtk_BaseView;
+ wxEvtHandler *_eventHandler;
+ ContourWrap_ViewControl *_lastInteraction;
+ std::string _lastInteractionName;
+ std::map<std::string, ContourWrap_ViewControl *> *_workingGroup;
+ bool _creatingMULT_ROI;
+ bool _editingROI;
+ bool _toIncludeAtInteractionGroup;
+ bool _waiting;
+ bool _creatingROI;
+ int _enventID;
+ int _leftClickCount;
+ int _rigthClickCount;
+ int clickX;
+ int clickY;
+ char _lastKeyCode;
+ long int onCharCallBackTimeEnd;
+ long int onCharNeeded;
+ bool _drawingSelectionROI;
+ manualRoiControler *_controlerSelectionROI;
+ manualViewRoi *_viewerSelectionROI;
+ manualBaseModel *_modelSelectionROI;
+ double _widthOfContour;
+ double _widthOfControlPoint;
+ bool _ctrlKey;
+ bool _shiftKey;
};
#endif // __wxVtkBaseView_SceneManager_HEADER_FILE__
#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);
change->SetInputConnection(img->GetProducerPort());
+#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;
}
#ifdef WIN32
char currentPath[_MAX_PATH];
- GetModuleFileName(NULL, currentPath, _MAX_PATH);
+
+ wchar_t currentPath2[512];
+ long result = GetModuleFileName(NULL, currentPath2, _MAX_PATH);
+// GetModuleFileName(NULL, currentPath, _MAX_PATH);
+ int ret = wcstombs ( currentPath, currentPath2, sizeof(pname) );
+
TEMPIMPORTOSIRIXFILE = currentPath;
TEMPIMPORTOSIRIXFILE = TEMPIMPORTOSIRIXFILE.substr(0,TEMPIMPORTOSIRIXFILE.find_last_of("\\"));
VTKImageToImageFilter<TOutputImage>
::SetInput( vtkImageData * inputImage )
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
m_Exporter->SetInput( inputImage );
+#else
+ m_Exporter->SetInputData( inputImage );
+#endif
}