: wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
{
- PANEL = "New Contour";
- PANEL1 = "I/O";
- PANEL2 = "Edit";
- PANEL3 = "Delete";
- PANEL4 = "Tools";
- PANEL5 = "Segmentation";
+ PANEL = "New Contour";
+ PANEL1 = "I/O";
+ PANEL2 = "Edit";
+ PANEL3 = "Delete";
+ PANEL4 = "Tools";
+ PANEL5 = "Segmentation";
segmentPanel = NULL;
segmentPanelITK = NULL;
- configPanel = NULL;
- spreadPanel = NULL;
- infoWin = NULL;
- infoPanel = NULL;
+ configPanel = NULL;
+ spreadPanel = NULL;
+ infoWin = NULL;
+ infoPanel = NULL;
infoPanelMask = NULL;
informationPanel = NULL;
- mirrorPanel = NULL;
+ mirrorPanel = NULL;
thresholdPanel = NULL;
currentWindow = NULL;
wxButton* b5 = getButton(toolpanel);
b5->SetClientData(&PANEL5);
- wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
+ 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* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
wxPanel* mentex5 = 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);
- menubar3 = new interfDeleteMenu(mentex3, sizex, sizey, evtHandler, datadir);
- menubar4 = new interfToolsMenu(mentex4, sizex,sizey, evtHandler, datadir);
- menubar5 = new interfSegmentationMenu(mentex5, sizex,sizey, evtHandler, datadir);
+ menubar = new interfNewContourMenu (mentex, sizex, sizey, evtHandler, datadir);
+ menubar1 = new interfIOMenu (mentex1, sizex, sizey, evtHandler, datadir);
+ menubar2 = new interfEditMenu (mentex2, sizex, sizey, evtHandler, datadir);
+ menubar3 = new interfDeleteMenu (mentex3, sizex, sizey, evtHandler, datadir);
+ menubar4 = new interfToolsMenu (mentex4, sizex ,sizey, evtHandler, datadir);
+ menubar5 = new interfSegmentationMenu(mentex5, sizex, sizey, evtHandler, datadir);
- statictext = getText(mentex, PANEL);
+ statictext = getText(mentex, PANEL);
statictext1 = getText(mentex1, PANEL1);
statictext2 = getText(mentex2, PANEL2);
statictext3 = getText(mentex3, PANEL3);
splitterwindow->SetSashGravity(1);
splitterwindow->SplitHorizontally(toolpanel, infoPanel);
- Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
+ 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(b3->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
interfMainPanel::~interfMainPanel(void)
{
-}
-interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler){
+}
+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){
interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler, datadir);
}
-
_newframe->Show(TRUE);
return interfmainpanel;
}
-interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler){
+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){
interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler);
}
-
_newframe->Show(TRUE);
return interfmainpanel;
}
-bool interfMainPanel::Show(bool show){
+
+bool interfMainPanel::Show(bool show)
+{
return _newframe->Show(show);
}
+
interfMainPanel* interfMainPanel::getInstance()
{
-
return interfmainpanel;
}
interfmainpanel = NULL;
}
-wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler){
-
-
+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) ;
flexsizer->Add(menu, wxFIXED_MINSIZE);
flexsizer->Add(toolspread, wxFIXED_MINSIZE);
-
- panel->Layout();
-
+
+ panel->Layout();
return panel;
}
-
/**
** Adds a new checkbox to the scrolledwindow using the checkboxsizer
** @Params id of contour
**
**/
-void interfMainPanel::addContourCheckBox(std::string id){
+void interfMainPanel::addContourCheckBox(std::string id)
+{
toolspread->addContourCheckBox(id);
}
** @Params id of contour
**
**/
-void interfMainPanel::removeContourCheckBox(std::string id){
+void interfMainPanel::removeContourCheckBox(std::string id)
+{
toolspread->removeContourCheckBox(id);
}
-void interfMainPanel::onActionButtonPressed1( wxCommandEvent& event ){
+void interfMainPanel::onActionButtonPressed1( wxCommandEvent& event )
+{
//((interfToolsMenu*)menubar4)->hideAxis();
wxButton* b = (wxButton*)event.GetEventObject();
wxPanel* dmenu;
std::string dstring = *((std::string*) b->GetClientData());
int sizechange=0;
-
if(dstring.compare(PANEL)==0){
dmenu = menubar;
text = statictext;
this->Refresh();
}
-wxStaticText* interfMainPanel::getText(wxWindow* parent, std::string nom){
+wxStaticText* interfMainPanel::getText(wxWindow* parent, std::string nom)
+{
return new wxStaticText(parent, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition,
- wxDefaultSize, wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
+ wxDefaultSize, wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
}
-wxButton* interfMainPanel::getButton(wxWindow* parent){
+wxButton* interfMainPanel::getButton(wxWindow* parent)
+{
wxButton* b = new wxButton(parent, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT,
- wxDefaultValidator, wxString(_T("-")));
+ wxDefaultValidator, wxString(_T("-")));
return b;
}
-wxPanel* interfMainPanel::setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text){
+wxPanel* interfMainPanel::setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text)
+{
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2);
parent->SetSizer(flexsizer, true);
parent->Layout();
return (wxPanel*)parent;
-
}
/**
sizer->Remove(currentWindow);
}
sizer->Add(panel);
- currentWindow = panel;
+ currentWindow = panel;
currentWindow->Show(true);
splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
/**
** Hide the panel in the lower box
**/
-void interfMainPanel::hidePanel( ){
+void interfMainPanel::hidePanel( )
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxSizer* sizer = infoPanel->GetSizer();
}
wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
sizer->Add(emptyPanel);
- currentWindow = emptyPanel;
+ currentWindow = emptyPanel;
currentWindow->Show(true);
splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
/**
** Gets the Information panel
**/
-wxPanel* interfMainPanel::getInfoPanel(){
+wxPanel* interfMainPanel::getInfoPanel()
+{
return infoPanel;
}
-void interfMainPanel::onCreateContourSpline( ){
+void interfMainPanel::onCreateContourSpline( )
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourSpline();
}
-void interfMainPanel::onCreateContourRectangle( ){
+
+void interfMainPanel::onCreateContourRectangle( )
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourRectangle();
}
-void interfMainPanel::onCreateContourCircle( ){
+void interfMainPanel::onCreateContourCircle( )
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourCircle();
}
-void interfMainPanel::onCreateContourLine( ){
+
+void interfMainPanel::onCreateContourLine( )
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourLine();
}
// RaC 09-09 ---------------------
-void interfMainPanel::onCreateContourPoints( ){
+void interfMainPanel::onCreateContourPoints( )
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourPoints();
}
// RaC 09-09 ---------------------
-void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull){
+void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull)
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
}
-void interfMainPanel::onDeleteContour(){
+
+void interfMainPanel::onDeleteContour()
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onDeleteContour();
}
-void interfMainPanel::onDeleteContoursActSlice(){
+
+void interfMainPanel::onDeleteContoursActSlice()
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
}
-void interfMainPanel::onDeleteAllContours(){
+
+void interfMainPanel::onDeleteAllContours()
+{
wxContourMainFrame::getInstance()->showAxis(false);
wxContourMainFrame::getInstance()->onDeleteAllContours();
}
-void interfMainPanel::onCopy(){
+void interfMainPanel::onCopy()
+{
wxContourMainFrame::getInstance()->onCopy();
}
-void interfMainPanel::onPaste(){
+
+void interfMainPanel::onPaste()
+{
wxContourMainFrame::getInstance()->onPaste();
}
-void interfMainPanel::onUndo(){
+
+void interfMainPanel::onUndo()
+{
wxContourMainFrame::getInstance()->onUndo();
}
-void interfMainPanel::onRedo(){
+
+void interfMainPanel::onRedo()
+{
wxContourMainFrame::getInstance()->onRedo();
}
-void interfMainPanel::onLoad(){
+
+void interfMainPanel::onLoad()
+{
wxContourMainFrame::getInstance()->onLoad();
}
-void interfMainPanel::onSave(){
- wxContourMainFrame::getInstance()-> onSave();
+
+void interfMainPanel::onSave()
+{
+ wxContourMainFrame::getInstance()->onSave();
}
-void interfMainPanel::RefreshInterface(){
+
+void interfMainPanel::RefreshInterface()
+{
wxContourMainFrame::getInstance()->RefreshInterface();
}
-vtkImageData* interfMainPanel::getImageData(){
+vtkImageData* interfMainPanel::getImageData()
+{
return wxContourMainFrame::getInstance()->getImageData();
}
wxContourMainFrame::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
}
-void interfMainPanel::onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation){
+void interfMainPanel::onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation)
+{
wxContourMainFrame::getInstance()->onSegmentationOneSliceITK(distance, sigma, alfa, beta, propagation, iterations, inflation);
}
-int interfMainPanel::GetImageDataSizeZ(){
+int interfMainPanel::GetImageDataSizeZ()
+{
return wxContourMainFrame::getInstance()->GetImageDataSizeZ();
}
-void interfMainPanel::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method){
+void interfMainPanel::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method)
+{
wxContourMainFrame::getInstance()->onSegmentationAllSlice(minZ, maxZ,isovalue,sampling,method);
}
-void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString){
+void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString)
+{
((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
}
-void interfMainPanel::onSegmentationPressed(){
+void interfMainPanel::onSegmentationPressed()
+{
if(segmentPanel == NULL){
segmentPanel = new wxPanel(getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
segmentPanel->SetSizer(flexsizer, true);
- segmentPanel->SetAutoLayout( true );
+ segmentPanel->SetAutoLayout(true);
segmentPanel->SetEventHandler(this);
//wxPanel* panel = contourevent->getSegmentationPanel(segmentPanel);
axisshown = true;
}
-void interfMainPanel::onSegmentationPressedITK(){
+void interfMainPanel::onSegmentationPressedITK()
+{
if(segmentPanelITK == NULL){
segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
axisshown = true;
}
-void interfMainPanel::onRigidPressed(){
+void interfMainPanel::onRigidPressed()
+{
wxContourMainFrame::getInstance()->onRigidPressed();
}
-void interfMainPanel::onWidthOfContour(double width){
+void interfMainPanel::onWidthOfContour(double width)
+{
wxContourMainFrame::getInstance()->onWidthOfContour(width);
}
-int interfMainPanel::getColorWindow(){
+int interfMainPanel::getColorWindow()
+{
return wxContourMainFrame::getInstance()->getColorWindow();
}
-int interfMainPanel::getWindowLevel(){
+int interfMainPanel::getWindowLevel()
+{
return wxContourMainFrame::getInstance()->getWindowLevel();
}
-void interfMainPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
+void interfMainPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
+{
wxContourMainFrame::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
}
}
-void interfMainPanel::onConfigurationPressed(){
+void interfMainPanel::onConfigurationPressed()
+{
if(configPanel == NULL){
configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
showPanel(configPanel);
}
-void interfMainPanel::onSpreadPressed(){
+void interfMainPanel::onSpreadPressed()
+{
if(spreadPanel==NULL){
spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
//hideAxis();
}
-void interfMainPanel::resetAppend(){
+void interfMainPanel::resetAppend()
+{
wxContourMainFrame::getInstance()->resetAppend();
}
-void interfMainPanel::onSpreadAdd(){
+void interfMainPanel::onSpreadAdd()
+{
wxContourMainFrame::getInstance()->onSpreadAdd();
}
-void interfMainPanel::appendStringSpread(std::string val){
+void interfMainPanel::appendStringSpread(std::string val)
+{
panelSpread->appendStringSpread(val);
}
-void interfMainPanel::onSpreadGo(int type){
+void interfMainPanel::onSpreadGo(int type)
+{
wxContourMainFrame::getInstance()->onSpreadGo(type);
}
-void interfMainPanel::setStringSpread(std::string stringtemp){
+
+void interfMainPanel::setStringSpread(std::string stringtemp)
+{
panelSpread->setStringSpread(stringtemp);
}
-void interfMainPanel::onInformationPressed(){
+void interfMainPanel::onInformationPressed()
+{
// Statistics frame
if(infoWin ==NULL){
- infoWin = new wxFrame (this, -1,_T(" Statistics "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
+ infoWin = new wxFrame (this, -1,_T(" Statistics "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
infoWin->SetSize( wxSize(825,650) );
wxSize sizepanel(825,675);
- informationPanel = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
+ informationPanel = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
- wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
- sizerPanel -> Add( informationPanel , 1, wxEXPAND ,0);
+ wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
+ sizerPanel -> Add( informationPanel, 1, wxEXPAND ,0);
infoWin->SetSizer( sizerPanel );
infoWin->SetAutoLayout( true );
wxContourMainFrame::getInstance()->changeInstant();
}
-void interfMainPanel::getInstantVector(std::vector<int>& tempVector){
+void interfMainPanel::getInstantVector(std::vector<int>& tempVector)
+{
wxContourMainFrame::getInstance()->getInstantVector(tempVector);
}
-std::vector<std::string> interfMainPanel::getOutlinesName(int slide){
+std::vector<std::string> interfMainPanel::getOutlinesName(int slide)
+{
return wxContourMainFrame::getInstance()->getOutlinesName(slide);
}
wxContourMainFrame::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ,grayRangeMin,grayRangeMax);
}
-void interfMainPanel::setStringInfoPanel(wxString tmpString){
+void interfMainPanel::setStringInfoPanel(wxString tmpString)
+{
if(informationPanel!=NULL){
((interfInformationPanel*)informationPanel)->setStringInfoPanel(tmpString);
}
}
-void interfMainPanel::setRowLabelInfoPanel(int z, wxString tempString){
+void interfMainPanel::setRowLabelInfoPanel(int z, wxString tempString)
+{
((interfInformationPanel*)informationPanel)->setRowLabelInfoPanel(z, tempString);
}
-int interfMainPanel::getNumberColsInformationPanel(){
+int interfMainPanel::getNumberColsInformationPanel()
+{
return ((interfInformationPanel*)informationPanel)->getNumberCols();
}
-void interfMainPanel::appendColsInformationPanel(int _numberOfVariablesStatistics){
+void interfMainPanel::appendColsInformationPanel(int _numberOfVariablesStatistics)
+{
((interfInformationPanel*)informationPanel)->appendCols(_numberOfVariablesStatistics);
}
-void interfMainPanel::setCellValueInfoPanel(int z,int tmpIntA,wxString tempString){
+void interfMainPanel::setCellValueInfoPanel(int z,int tmpIntA,wxString tempString)
+{
((interfInformationPanel*)informationPanel)->setCellValue(z, tmpIntA, tempString);
}
-void interfMainPanel::setColLableInfoPanel(int tmpIntB,wxString tmpTitleString){
+void interfMainPanel::setColLableInfoPanel(int tmpIntB,wxString tmpTitleString)
+{
((interfInformationPanel*)informationPanel)->setColLabel(tmpIntB, tmpTitleString);
}
{
axisshown=false;
wxContourMainFrame::getInstance()->showAxis(axisshown);
- wxContourMainFrame::getInstance()->onSnakePressed();
+ wxContourMainFrame::getInstance()->onSnakePressed();
}
void interfMainPanel::onMirrorPressed(){
return;
}
- wxTextEntryDialog* dialog = new wxTextEntryDialog(this,"Enter a tag name: ") ;
+ wxTextEntryDialog* dialog = new wxTextEntryDialog(this,_T("Enter a tag name: ")) ;
if (dialog->ShowModal() == wxID_OK)
{
}
}
}
+
void interfMainPanel::onCalibration(wxString size, int unit)
{
int type = 0;
}
else
{
-
wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please select a line contour"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
dial->ShowModal();
}
wxContourMainFrame::getInstance()->onePixelSize (_pixelValue);
return _pixelValue ;
}
+
double interfMainPanel::GetPixelValue()
{
return _pixelValue;
}
-//------------------------------------------------------------------------------------------------------------
\ No newline at end of file
+//------------------------------------------------------------------------------------------------------------