--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#include "bbcreaContoursOnSave.h"
+#include "bbcreaContoursPackage.h"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,OnSave)
+BBTK_BLACK_BOX_IMPLEMENTATION(OnSave,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void OnSave::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+
+
+ if (wxContourMainFrame::getInstance()!=NULL)
+ {
+ if ( wxContourMainFrame::getInstance()->GetFileLocation().empty()==false )
+ {
+ wxContourMainFrame::getInstance()->onSave();
+ } // if FileLocation
+ } // if getInstance
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void OnSave::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+// bbSetInputIn(0);
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void OnSave::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void OnSave::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaContours
+
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#ifndef __bbcreaContoursOnSave_h_INCLUDED__
+#define __bbcreaContoursOnSave_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT OnSave
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(OnSave,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+// BBTK_DECLARE_INPUT(Active,bool);
+// BBTK_DECLARE_OUTPUT(Out,double);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(OnSave,bbtk::AtomicBlackBox);
+ BBTK_NAME("OnSave");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+
+// BBTK_INPUT(OnSave,Active,"(default false) true/false",bool,"");
+
+// BBTK_OUTPUT(OnSave,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(OnSave);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+}
+// EO namespace bbcreaContours
+
+#endif // __bbcreaContoursOnSave_h_INCLUDED__
+
#include "wxContourMainFrame.h"
-
namespace bbcreaContours
{
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-
-printf("EED SetFileLocation::Process Start %s \n", bbGetInputFileLocation().c_str() );
-
- if (wxContourMainFrame::getInstance()->GetFileLocation().empty()==true)
- {
- wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
- }else {
- wxContourMainFrame::getInstance()->onSave();
- wxContourMainFrame::getInstance()->deleteAllContours();
- wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
- } // if FileLocaton
-
- wxContourMainFrame::getInstance()->onLoad();
- wxContourMainFrame::getInstance()->RefreshInterface();
-printf("EED SetFileLocation::Process End\n");
+ if (wxContourMainFrame::getInstance()!=NULL)
+ {
+ if (wxContourMainFrame::getInstance()->GetFileLocation().empty()==true)
+ {
+ wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
+ }else {
+ wxContourMainFrame::getInstance()->onSave();
+ wxContourMainFrame::getInstance()->deleteAllContours();
+ wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
+ } // if FileLocaton
+
+ wxContourMainFrame::getInstance()->onLoad();
+ wxContourMainFrame::getInstance()->RefreshInterface();
+ } // if Instance
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler)
{
-printf("EED interfImageToolsMenu::initButtons start\n");
std::vector<std::string> path, nom;
std::vector<wxObjectEventFunction> funct;
-/*EED Borrame
- path.push_back(datadir + "/Segmentation.png");
- nom.push_back("Find shapes by automatic segmentation");
- funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressed);
-
- path.push_back(datadir + "/ITK.png");
- nom.push_back("Find shapes by automatic segmentation with ITK");
- funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressedITK);
-
- path.push_back(datadir + "/snake.png");
- nom.push_back("Find shapes using border snake interaction");
- funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSnakePressed);
-*/
path.push_back(datadir + "/pignon.png");
nom.push_back("Configuration of the window");
funct.push_back((wxObjectEventFunction) &interfImageToolsMenu:: onConfigurationPressed);
this->addButtons(path, nom);
this->setVectorFunction(funct);
this->connectEvents(evtHandler);
-printf("EED interfImageToolsMenu::initButtons End\n");
}
interfImageToolsMenu::~interfImageToolsMenu()
// Constructors & Destructors
//------------------------------------------------------------------------------------------------------------
-wxContourMainFrame* wxContourMainFrame:: instance = NULL;
+wxContourMainFrame* wxContourMainFrame::instance=NULL;
char wxContourMainFrame::COPY = 'C';
wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style)
_viewThresholdImage = NULL;
_viewThresholdImagePanel = NULL;
_viewColorLayerImagePanel = NULL;
-
_frameShowResultImages = NULL;
}
wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir )
{
- if(instance == NULL){
- instance = new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir);
+ if(instance == NULL)
+ {
+ instance=new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir);
}
return instance;
}
- std::vector<vtkImageData*> wxContourMainFrame ::getVectImages()
+ std::vector<vtkImageData*> wxContourMainFrame::getVectImages()
{
return kernelManager->getVectImages();
}
- wxContourMainFrame* wxContourMainFrame :: getInstance()
+ wxContourMainFrame* wxContourMainFrame::getInstance()
{
return instance;
}
- void wxContourMainFrame :: resetInstance()
+ void wxContourMainFrame::resetInstance()
{
instance->Destroy();
}
- wxContourMainFrame :: ~wxContourMainFrame()
+ wxContourMainFrame::~wxContourMainFrame()
{
delete _contourextractdata;
deleteAllContours();
// Creational and initialization methods using WxAui
//------------------------------------------------------------------------------------------------------------
//
- wxAuiNotebook * wxContourMainFrame :: createNotebook()
+ wxAuiNotebook * wxContourMainFrame::createNotebook()
{
wxSize client_size = GetClientSize();
wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
//------------------------------------------------------------------------------------------------------------
// Creational and initialization methods
//------------------------------------------------------------------------------------------------------------
- bool wxContourMainFrame :: configurePanels( )
+ bool wxContourMainFrame::configurePanels( )
{
bool configured = _theViewPanel!=NULL;
{
wxDialog* dial = new wxDialog (this,-1,_T("Tools"),wxDefaultPosition, wxSize(460,360));
wxSizer* buttonsSizer = dial->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
- wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL);
+// wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL);
+ wxFlexGridSizer *dialSizer = new wxFlexGridSizer(1);
wxString lstOptOperation[2];
lstOptOperation[0]=_T("By Dimension");
lstOptOperation[1]=_T("By Spacing");
- wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,45), 2 , lstOptOperation, 2, wxRA_SPECIFY_COLS);
+ wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,90), 2 , lstOptOperation, 2, wxRA_SPECIFY_COLS);
dialSizer->Add( new wxStaticText(dial,-1,_T("The image resolution is not compatible with the ")) , 0, wxGROW );
dialSizer->Add( new wxStaticText(dial,-1,_T("selected Roi file. Do you want to tranform it?")) , 0, wxGROW );