#ifndef __wxContourEventHandler_h_INCLUDED_H__ #define __wxContourEventHandler_h_INCLUDED_H__ // ----------------------------------------------------------------------------------------------------------- // WX headers inclusion. // For compilers that support precompilation, includes . // ----------------------------------------------------------------------------------------------------------- #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif #include #include //------------------------------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------------------------------ #include #include "wxContourMainFrame.h" #include #include "OutlineModelManager.h" #include "ContourWorkspace.h" #include "wxInstantChooserPanel.h" #include "wxContour_ButtonsBar.h" #include "wxContour_Grid.h" #include "wxContour_DrawToolsPanel.h" #include "wxContour_OperationsToolsPanel.h" #include "wxContour_AutomaticFormsToolsPanel.h" #include "wxContour_StandardToolsPanel.h" #include "wxContour_EdtionToolsPanel.h" #include "wxContour_ListViewPanel.h" #include "wxContour_ActionCommandsID.h" #include "PerformingOperation.h" #include "ContourThing.h" #include "AxeThing.h" #include "ImageSourceThing.h" #include "ImageSectionThing.h" #include "InstantMembersNameList.h" #include "OutlineGroup.h" #include "SomeEnvironment.h" #include "ContourWorkspace.h" #include "ContourWrap_ViewControl.h" #include "Instant.h" #include "wxVtkBaseView_SceneManager.h" #include "Contour/ContourPropagation.h" #include "mBarRange.h" #include "PanelBullEyeOptions.h" /** file wxContourEventHandler.h */ /* class PanelBullEyeOptions : public wxPanel { public: PanelBullEyeOptions(wxWindow* parent, wxSize size); ~PanelBullEyeOptions (); void onRefreshPanel( wxCommandEvent& event ); int GetNumberOfCrowns(); int GetNumberOfSections(int nCrown); int GetRadioOfCrown(int nCrown); double GetAngOfCrownSection(int nCrown,int section); double GetAngDeltaOfCrownSection(int nCrown); protected: private: int _maxLevels; int _maxSections; wxRadioBox *_radioboxBullEyeGenOpt; wxSpinCtrl *_spinctrlBullEyeNumOfCrowns; wxSpinCtrl *_spinctrlBullEyeNumOfSec; wxSlider *_sliderBullEyeAngle; std::vector _lstBullEyeDetailNumOfSec; std::vector _lstBullEyeDetailRadio; std::vector _lstBullEyeDetailAngle; void RefreshPanel(); };*/ //------------------------------------------------------------------------------------------------------------ // Class definition //------------------------------------------------------------------------------------------------------------ class wxContourEventHandler : public wxEvtHandler { public: //------------------------------------------------------------------------------------------------------------ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ wxContourEventHandler(); ~wxContourEventHandler(); //------------------------------------------------------------------------------------------------------------ // Configuration methods //------------------------------------------------------------------------------------------------------------ bool configureEventsHandling(); //------------------------------------------------------------------------------------------------------------ // Methods for capturing events //------------------------------------------------------------------------------------------------------------ void onProcessMessage( wxCommandEvent& event ); void onActionButtonPressed( wxCommandEvent& event ); void onChangedDeep ( wxCommandEvent& event ); void onChangeInstant( wxCommandEvent& event ); void onCreateMultipleROI( wxCommandEvent& event ); void onSelectMultipleROI( wxCommandEvent& event ); void onCreateROI( wxCommandEvent& event ); void onStopCreateROI( wxCommandEvent& event ); void onDeleterROI( wxCommandEvent& event ); void onSelectROI( wxCommandEvent& event ); void onUnSelectROI( wxCommandEvent& event ); void onManualHidedROI( wxCommandEvent& event ); void onManualShowedROI( wxCommandEvent& event ); void onEditingROI( wxCommandEvent& event ); void onMovingROI( wxCommandEvent& event ); //------------------------------------------------------------------------------------------------------------ // Model management methods //------------------------------------------------------------------------------------------------------------ void createCopyContourOf( std::string anExistingKName, std::vector &instantNoTouchData, bool append = false ); void createContour( int typeContour=1 ); void deleteContour( std::string theKeyName ); void deleteContours( std::vector keyNamesVector ); void deleteAllContours( ); void openContours( FILE *pFile, bool staticContour ); void openFileWithContours(); void saveFileWithContours(); void saveFileWithContours( std::string filename ); void saveFileWithContoursAutomatique(); void onSpread( ); void onSpreadInDepth( std::vector & keyNamesVector ); void onAutomatiqueSegmentation( ); void onOutline_Union_Of( std::vector & keyNamesVector ); void onOutline_Intersection_Of( std::vector & keyNamesVector ); void onOutline_Combination_Of( std::vector & keyNamesVector ); void onOutline_Fragmentation_Of( std::vector & keyNamesVector ); void onOutline_Agrupation_Of( std::vector & keyNamesVector ); void onCopyOutlines( std::vector & keyNamesVector ); void onPasteOutlines( ); void onShowOutlines( std::vector & keyNamesVector ); void onHideOutlines( std::vector & keyNamesVector ); void onSelectOutlines( std::vector & keyNamesVector ); void onEditOutlines( std::vector & keyNamesVector ); void onREDO(); void onUNDO(); void changeContourOfManager(std::string keyName, Instant *instant); void changeContoursOfManager(std::vector & keyNamesVector); //------------------------------------------------------------------------------------------------------------ // Attributes getters and setters //------------------------------------------------------------------------------------------------------------ void setModelManager( OutlineModelManager * theModelManager ); void setViewPanel( wxContourViewPanel* theViewPanel ); void setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel ); void setButtonsBar( wxContour_ButtonsBar * theButtonsBar ); void setGrid( wxContour_Grid * theGridPanel ); void setDrawToolsPanel( wxContour_DrawToolsPanel * theDrawToolsPanel ); void setOperationsToolsPanel( wxContour_OperationsToolsPanel * theDrawToolsPanel ); void setAutomaticFormsPanel( wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel ); void setStandardToolsPanel( wxContour_StandardToolsPanel * theStandardToolsPanel ); void setEditionToolsPanel( wxContour_EdtionToolsPanel * theEditionToolsPanel ); void setListViewPanel( wxContour_ListViewPanel * theListViewPanel ); //------------------------------------------------------------------------------------------------------------ // Other functional methods //------------------------------------------------------------------------------------------------------------ void executeActionCommand( const char toolCommand ); //------------------------------------------------------------------------------------------------------------ // Getting information methods //------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------ // Responding Spread Tools //------------------------------------------------------------------------------------------------------------ void onSpreadReset( wxCommandEvent& event ); void onSpreadAdd( wxCommandEvent& event ); void onSpreadGo( wxCommandEvent& event ); void onSegmentationAllSlice( wxCommandEvent& event ); void onSegmentationOneSlice( wxCommandEvent& event ); void SegmentationOneSlice( int x, int y, int z ); void onTest( wxCommandEvent& event ); void onTestReset( wxCommandEvent& event ); void onTestAdd( wxCommandEvent& event ); void onTestGo( wxCommandEvent& event ); void onCreateContourSpline( wxCommandEvent& event ); void onCreateContourRectangle( wxCommandEvent& event ); void onCreateContourCircle( wxCommandEvent& event ); void onCreateContourBullEye( wxCommandEvent& event ); void onCreateContourFrame( ); void onDeleteFrame( ); void onDeleteContour( wxCommandEvent& event ); void onDeleteContoursActSlice( wxCommandEvent& event ); void onDeleteAllContours( wxCommandEvent& event ); void onInformationContourFrame(); void onInformationContourLabels( wxCommandEvent& event ); void onExtractInformation( wxCommandEvent& event ); void onSaveResults( wxCommandEvent& event ); void onInterfaceConfigurationFrame(); void onWidthOfContour(wxScrollEvent& event); void onBrigthnessColorWindowLevel(wxScrollEvent& event); void OnInterpolation(wxCommandEvent& event); void onInterfaceTestFrame(); void SaveValuesXYZ(std::string directory,std::string namefile); void SaveImageResult(std::string directory,std::string namefile); /** ** JCP 13-10-08 This methods group the diferent kind of panels **/ wxPanel* getInformationPanel(wxWindow* parent); wxPanel* getConfigurationPanel(wxWindow* parent); wxPanel* getSegmentationPanel(wxWindow* parent); wxPanel* getSegmentationPanelITK(wxWindow* parent); wxPanel* getSpreadPanel(wxWindow* parent); void onSegmentationAllSliceITK( wxCommandEvent& event ); void onSegmentationOneSliceITK( wxCommandEvent& event ); void onSnakePressed(wxWindow* parent); void showAxis(bool show); //JCP 13-10-09 Fill grid as public void FillGridWithContoursInformation(); //JCP 13-10-09 //JCP 16-10-09 void createContourBullsEye(PanelBullEyeOptions* panel ); //void getValuesXYZ(std::vector* vectx, std::vector* vecty, std::vector* vectz, std::vector* size); //JCP 22-10-09 /** ** This method gets the information of the contours in each slice **/ void getValuesXYZ(double ** vectx, double ** vecty, double ** vectz, std::vector* size); /** ** This method gets the mask and value images generated by the contours **/ void getMaskValue(vtkImageData* mask, vtkImageData* value); /**This Method checks for the information panel, it initalizes all the values ** in the controls so they can be retreived **/ void checkInformationPanel(); //JCP 22-10-09 //JCP 16-10-09 private: //------------------------------------------------------------------------------------------------------------ // Private methods //------------------------------------------------------------------------------------------------------------ void updateInstantOutlines(); void updateInstantImageData(); void updateInstantAxes(); void changeInstant(); void RefreshInterface(); // EED //JCP 13-10-09 must be a public method //void FillGridWithContoursInformation(); //JCP 13-10-09 manualContourModel * factoryManualContourModel(int typeContour); manualContourModel * factoryManualContourModel(PanelBullEyeOptions* panel); std::vector ExploseEachModel( std::vector lstManConMod ); //------------------------------------------------------------------------------------------------------------ // Attributtes //------------------------------------------------------------------------------------------------------------ wxContourViewPanel* _theViewPanel; OutlineModelManager * _modelManager; ContourWorkspace * _workSpace; wxInstantChooserPanel * _instantPanel; wxContour_ButtonsBar * _buttonsBar; wxVtkBaseView_SceneManager * _sceneManager; Instant * _actualInstant; wxContour_Grid * _gridPanel; wxContour_DrawToolsPanel * _drawToolsPanel; wxContour_OperationsToolsPanel * _operationsToolsPanel; wxContour_AutomaticFormsToolsPanel * _autoFormsPanel; wxContour_StandardToolsPanel * _standardToolsPanel; wxContour_EdtionToolsPanel * _editionToolsPanel; wxContour_ListViewPanel * _listViewPanel; /*DECLARE_CLASS(wxContourMainFrame) // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE()*/ bool _creatingContoursActive; PerformingOperation * _performingOperation; // Interface EED wxFrame *_spreadFrame; wxFrame *_segmentationFrame; wxFrame *_createContourFrame; wxFrame *_deleteFrame; wxFrame *_InformationContourFrame; wxFrame *_interfaceConfigurationFrame; wxFrame *_TestFrame; wxTextCtrl * _wxtextctrlTest; std::string fileNameContourROI; wxRadioBox *methodRadiobox; ContourPropagation *_contourPropagation; wxSlider *_isovalue; wxSlider *_sampling; wxStaticText *_staticTextSegmentation; mBarRange *_mbarrange; wxTextCtrl *_wxtextctrlSpread; wxRadioBox *_informationRadiobox; wxListCtrl *_wxlistctrl; wxGrid *_grid; wxStaticText *_staticTextInformation; mBarRange *_mbarrangeSliceInformation; mBarRange *_mbarrangeRangeInformation; wxSlider *_withOfContourLine; wxSlider *_brithtnessWindowLevel; wxSlider *_brithtnessColorLevel; mBarRange *_mbarrangeDeleteAll; wxCheckBox *_interpolationCheckBox; wxRadioBox *_spreadMethodRadiobox; wxRadioBox *_radiolstboxContourGroup; wxStaticText *_staticTextSpread; PanelBullEyeOptions *_panelBullEyeOptions; int _numberOfVariablesStatistics; int inundo; int inredo; std::string stundoredo; void saveState(); void loadState(std::string filename); std::string intToString(int num); }; #endif // __wxContourEventHandler_HEADER_FILE__