From: Eduardo DAVILA Date: Tue, 17 Dec 2019 20:18:46 +0000 (+0100) Subject: #3328 creaContours Feature New Normal - SetFileLocation box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=00bfeafb3fccce1256ae503a345ebfcaacc6a960;p=creaContours.git #3328 creaContours Feature New Normal - SetFileLocation box --- diff --git a/bbtk/src/bbCreaContournDimensions.cxx b/bbtk/src/bbCreaContournDimensions.cxx index 251d4ff..6d8890d 100644 --- a/bbtk/src/bbCreaContournDimensions.cxx +++ b/bbtk/src/bbCreaContournDimensions.cxx @@ -32,16 +32,14 @@ namespace bbcreaContours BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,nDimensions) BBTK_BLACK_BOX_IMPLEMENTATION(nDimensions,bbtk::WxBlackBox); + void nDimensions::Process() { double **vectx = 0, **vecty = 0, **vectz = 0; - std::vector< void * > vectortemp; std::vector size; vtkImageData **mask = 0, **value = 0; - vtkImageData* img = bbGetInputIn(); - std::vector selectedimages; if(img!=NULL && currentimg!=img) { diff --git a/bbtk/src/bbCreaContournDimensions.h b/bbtk/src/bbCreaContournDimensions.h index a5f7013..616a70c 100644 --- a/bbtk/src/bbCreaContournDimensions.h +++ b/bbtk/src/bbCreaContournDimensions.h @@ -65,7 +65,6 @@ class /*BBTK_EXPORT*/ nDimensions BBTK_DECLARE_OUTPUT(SizeContour,std::vector ); BBTK_DECLARE_OUTPUT(wxContourMainFrame,wxContourMainFrame*); - private: //wxContourMainFrame* frame; vtkImageData* currentimg; diff --git a/bbtk/src/bbcreaContoursSetFileLocation.cxx b/bbtk/src/bbcreaContoursSetFileLocation.cxx new file mode 100644 index 0000000..2274585 --- /dev/null +++ b/bbtk/src/bbcreaContoursSetFileLocation.cxx @@ -0,0 +1,92 @@ +//===== +// 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 "bbcreaContoursSetFileLocation.h" +#include "bbcreaContoursPackage.h" + +#include "wxContourMainFrame.h" + + +namespace bbcreaContours +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,SetFileLocation) +BBTK_BLACK_BOX_IMPLEMENTATION(SetFileLocation,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 SetFileLocation::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 = " <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"); + +} +//===== +// 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 SetFileLocation::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputFileLocation(""); + +} +//===== +// 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 SetFileLocation::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 SetFileLocation::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaContours + + diff --git a/bbtk/src/bbcreaContoursSetFileLocation.h b/bbtk/src/bbcreaContoursSetFileLocation.h new file mode 100644 index 0000000..e04452c --- /dev/null +++ b/bbtk/src/bbcreaContoursSetFileLocation.h @@ -0,0 +1,49 @@ +//===== +// 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 __bbcreaContoursSetFileLocation_h_INCLUDED__ +#define __bbcreaContoursSetFileLocation_h_INCLUDED__ + +#include "bbcreaContours_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +namespace bbcreaContours +{ + +class bbcreaContours_EXPORT SetFileLocation + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(SetFileLocation,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(FileLocation, std::string); +// 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(SetFileLocation,bbtk::AtomicBlackBox); + BBTK_NAME("SetFileLocation"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(SetFileLocation,FileLocation,"File Location",std::string,""); + +// BBTK_OUTPUT(SetFileLocation,Out,"First output",double,""); + +BBTK_END_DESCRIBE_BLACK_BOX(SetFileLocation); +//===== +// 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 // __bbcreaContoursSetFileLocation_h_INCLUDED__ + diff --git a/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx b/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx index 32f8294..e10e836 100644 --- a/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx @@ -119,9 +119,7 @@ void interfSegmentationMenu::onSnakePressed(wxCommandEvent& event) 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) diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index b301675..9fbe24a 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -852,7 +852,7 @@ void wxContourMainFrame :: createMirrorContourOf ( std::string anExistingKName, mp->SetPointX( vecOut[0] ); mp->SetPointY( vecOut[1] ); mp->SetPointZ( vecOut[2] ); - } + } // for i _theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append ); } @@ -3238,7 +3238,9 @@ void wxContourMainFrame::onSnakePressed(){ } -void wxContourMainFrame::saveFileWithContoursAutomatique(){ +void wxContourMainFrame::saveFileWithContoursAutomatique() +{ +printf("EED wxContourMainFrame::saveFileWithContoursAutomatique \n"); std::string filename = kernelManager->getCurrentFileName(); if(filename.compare("")!=0){ saveFileWithContours(filename); @@ -3246,7 +3248,8 @@ void wxContourMainFrame::saveFileWithContoursAutomatique(){ onSave(); } } -void wxContourMainFrame::ShowToolsPanel(bool show){ +void wxContourMainFrame::ShowToolsPanel(bool show) +{ _pannew->Show(show); } @@ -3451,6 +3454,9 @@ void wxContourMainFrame::SetFileLocation(std::string newFileLocation) { _fileLocation = newFileLocation; std::cout<<"GETFILELOCATION:"<<_fileLocation<setCurrentFileName(_fileLocation); } //------------------------------------------------------------------------------------------------------------ diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h index b633d14..2434fb4 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h @@ -119,58 +119,36 @@ //------------------------------------------------------------------------------------------------------------ class interfMainPanel; class wxContourMainFrame : public wxPanel { - public: - //------------------------------------------------------------------------------------------------------------ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ - - wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER); wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector images, long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,std::string datadir="C:/Creatis/creaContoursBin/RelWithDebInfo/"); - ~wxContourMainFrame(); - //------------------------------------------------------------------------------------------------------------ // Creational and initialization methods //------------------------------------------------------------------------------------------------------------ - void setVectImages(std::vector imgs); - bool configurePanels( ); - bool addNewPanel(wxPanel* panel); - wxAuiNotebook * createNotebook(); - void createInstantChooserPanel(wxAuiNotebook * parent); - void createViewPanel(wxAuiNotebook * parent); - void createInstantChooserPanel(wxWindow * parent); - void createViewPanel(wxWindow * parent); - void setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel ); - void getMaskValue(vtkImageData ** mask,vtkImageData ** value,int typeContourGroup, int selection, int minZ, int maxZ); - void SaveImageResult(std::string directory,std::string namefile, vtkImageData* mask,vtkImageData* value); - void ShowToolsPanel(bool show); - - ////------------------------------------------------------------------------------------------------------------ //// Methods for capturing events ////------------------------------------------------------------------------------------------------------------ - ////------------------------------------------------------------------------------------------------------------ //// Model management methods ////------------------------------------------------------------------------------------------------------------ - //------------------------------------------------------------------------------------------------------------ // Attributes getters and setters //------------------------------------------------------------------------------------------------------------