]> Creatis software - creaContours.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 16 Jul 2010 17:32:44 +0000 (17:32 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 16 Jul 2010 17:32:44 +0000 (17:32 +0000)
appli/wxContourGUIExample/wxContourGUIExample.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h

index 1e93eb1be2e629390a8dd341c4a6e4af1d80c637..fd48714364c1e224174cb93a028761999186f9c6 100644 (file)
@@ -1,7 +1,7 @@
 //----------------------------------------------------------------------------------------------------------------
 // Class definition include
 //----------------------------------------------------------------------------------------------------------------
-
 #include "wxContourGUIExample.h"
 #include "wxContourMainFrame.h"
 //#include "OutlineModelManager.h"
index d9c4e6ce2855f026c17a94189ba385b8b32df9bb..6bbd832e4b0305712b2bcb9d495e2f411a6bdc0a 100644 (file)
@@ -887,7 +887,7 @@ void interfMainPanel::onColorLayerImagePressed()
                colorImageLayerPanel->SetSizer(flexsizer, true);
                colorImageLayerPanel->SetAutoLayout( true );    
                //configPanel->SetEventHandler(this->contourevent);
-               wxPanel *panel = wxContourMainFrame::getInstance()->getThresholdImageViewPanel( colorImageLayerPanel );                         
+               wxPanel *panel = wxContourMainFrame::getInstance()->getColorLayerImageViewPanel( colorImageLayerPanel );                                
                wxStaticText* stattext = new wxStaticText(colorImageLayerPanel, -1, wxString(_T("   Color Image Layer     ")), wxDefaultPosition,
                                                                                                  wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
@@ -908,7 +908,7 @@ void interfMainPanel::onThresholdPressed()
                thresholdPanel->SetSizer(flexsizer, true);
                thresholdPanel->SetAutoLayout( true );  
                //configPanel->SetEventHandler(this->contourevent);
-               wxPanel *panel = wxContourMainFrame::getInstance()->getColorLayerImageViewPanel( thresholdPanel );                              
+               wxPanel *panel = wxContourMainFrame::getInstance()->getThresholdImageViewPanel( thresholdPanel );                               
                wxStaticText* stattext = new wxStaticText(thresholdPanel, -1, wxString(_T("   Threshold segmentation    ")), wxDefaultPosition,
                                                                                                  wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
index 499121e075499d8b22bf28899922dc1cd10317f9..a1276c02d64c391390055a37a38fd98ebd07023c 100644 (file)
@@ -68,7 +68,8 @@ char wxContourMainFrame::COPY = 'C';
                _viewMaskImagePanel                     = NULL;
                _viewThresholdImage                     = NULL;
                _viewThresholdImagePanel        = NULL;
-
+               _viewColorLayerImage            = NULL;
+               _viewColorLayerImagePanel       = 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)         
@@ -88,6 +89,8 @@ char wxContourMainFrame::COPY = 'C';
                _viewMaskImagePanel                     = NULL;
                _viewThresholdImage                     = NULL;
                _viewThresholdImagePanel        = NULL;
+               _viewColorLayerImage            = NULL;
+               _viewColorLayerImagePanel       = NULL;
 
                // set up default notebook style
                m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
@@ -670,7 +673,15 @@ void wxContourMainFrame::changeInstant()
                                _viewThresholdImage->onThreshold();
                        }
                }
-       
+
+       // Refresh Threshold image
+               if(_viewColorLayerImage!=NULL){
+                       _viewColorLayerImage->SetZ(actualSlice);                        
+                       if (_viewColorLayerImagePanel->IsVisible()==true){
+                               _viewColorLayerImage->onThreshold();
+                       }
+               }
+
                updateInstantOutlines();
                updateInstantImageData();
                updateInstantAxes();
@@ -3028,20 +3039,15 @@ wxPanel *wxContourMainFrame::getColorLayerImageViewPanel(wxWindow *parent)
 {
        if      (_viewColorLayerImagePanel==NULL)
        {
-               _viewColorLayerImagePanel =  new wxPanel(parent, -1);
-/*EED Borrame
                double range[2];
                _theViewPanel->getImageData()->GetScalarRange(range);
                int min = (int)floor (range[0]);
                int max = (int)ceil (range[1]);         
-               _viewColorLayerImagePanel = new ThresholdImageViewPanel( parent, min, max , 1);
-               _viewThresholdImage = new ThresholdImageView();
-               _viewThresholdImage->SetImage( _theViewPanel->getImageData() );
-               _viewThresholdImage->SetminMaxValue( min, max);
-               _viewThresholdImage->SetBaseColor( 1,0,0 );
-               _viewThresholdImagePanel->SetThresholdImageView( _viewThresholdImage );
-               _viewThresholdImage->SetwxVtkBaseView( _theViewPanel->getWxVtkBaseView() );
-*/
+               _viewColorLayerImagePanel = new ColorLayerImageViewPanel( parent, min, max , 1);
+               _viewColorLayerImage = new ColorLayerImageView();
+               _viewColorLayerImage->SetImage( _theViewPanel->getImageData() );
+               _viewColorLayerImagePanel->SetColorLayerImageView( _viewColorLayerImage );
+               _viewColorLayerImage->SetwxVtkBaseView( _theViewPanel->getWxVtkBaseView() );
        }
        return _viewColorLayerImagePanel;
 }
index 4b6ac62729b2880ad58c47c5bef8665d0710ed8a..32adc0fdc3ea420d6386875133142b03763011fa 100644 (file)
 
 #include "ThresholdImageView.h"
 #include "ThresholdImageViewPanel.h"
-//EED #include "ColorLayerImageView.h"
-//EED #include "ColorLayerImageViewPanel.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 "PerformingOperation.h"
-
-//#include "ContourThing.h"
-
-//#include "OutlineModelManager.h"
-
-//#include "wxContour_ButtonsBar.h"
-//#include "wxContour_ControlPanel.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 "ColorLayerImageView.h"
+#include "ColorLayerImageViewPanel.h"
 
 
 //ITK
@@ -165,16 +137,6 @@ class wxContourMainFrame : public wxPanel {
        void ShowToolsPanel(bool show);
 
 
-//     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 );
-
-
        ////------------------------------------------------------------------------------------------------------------
        //// Methods for capturing events
        ////------------------------------------------------------------------------------------------------------------
@@ -275,28 +237,17 @@ class wxContourMainFrame : public wxPanel {
 //==================================================================================================== 
 
        void showAxis(bool show);
-
        void onRigidPressed();
-
        void onWidthOfContour(double width);
-
        int getColorWindow();
        int getWindowLevel();
-
        void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
-
        void onInterpolation(bool interpolate);
-
        void onChangeInstant(std::string name,int actual);
-
        void resetAppend();
-
        void onSpreadAdd();
-
        void onSpreadGo(int type);
-
        void getInstantVector(std::vector<int>& tempVector);
-
        std::vector<std::string> getOutlinesName(int slide);
 
        //
@@ -304,22 +255,13 @@ class wxContourMainFrame : public wxPanel {
        // @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 );
-
        wxPanel *getMaskImageViewPanel(wxWindow *parent);
        void SetContourGroup(int contourGroup);
        wxPanel *getThresholdImageViewPanel(wxWindow *parent);
@@ -389,19 +331,12 @@ private:
        //------------------------------------------------------------------------------------------------------------
        
        int _contourGroup;
-       
        static wxContourMainFrame* instance;
-
        KernelManagerContour* kernelManager;
-
        interfMainPanel* _pannew;
-
        PerformingOperation* _performingOperation;
-
        std::string _datadir;
-
        wxContourViewPanel* _theViewPanel;
-
        wxInstantChooserPanel * _instantPanel;
 
        //AD: 03-09: This attributes represents the reference line that is going to be used for the mirroring
@@ -409,16 +344,12 @@ private:
        manualContourModelLine  * _refLineModel;
        manualViewLine          * _refLineView;
 
-
-
        wxAuiManager m_mgr;
        wxAuiNotebook * notebook;
-
     long m_notebook_style;
     long m_notebook_theme;
     int _numberOfVariablesStatistics;
        
-
        // Contour Image Mask
        ThresholdImageView                      *_viewMaskImage;
        ThresholdImageViewPanel         *_viewMaskImagePanel;
@@ -428,44 +359,30 @@ private:
        ThresholdImageViewPanel         *_viewThresholdImagePanel;
        
        // Color Layer Image
-//EED  ColorLayerImageView                     *_viewColorLayerImage;
-//EED  ColorLayerImageViewPanel        *_viewColorLayerImagePanel;
-       wxPanel                                         *_viewColorLayerImagePanel;
-
+       ColorLayerImageView                     *_viewColorLayerImage;
+       ColorLayerImageViewPanel        *_viewColorLayerImagePanel;
        std::vector<vtkImageData*> _images;
-
        bool _actorPresent;
 
-       
-       
-       
-
        /*DECLARE_CLASS(wxContourMainFrame)
        // any class wishing to process wxWindows events must use this macro
        DECLARE_EVENT_TABLE()*/
        bool _creatingContoursActive;
 ////////JCP 21 - 11 - 08
        void createContour( int typeContour );
-
        //manualContourModel * factoryManualContourModel(int typeContour);
-
        manualBaseModel * factoryManualContourModel(wxPanel* panel);
-       
        ContourExtractData      *_contourextractdata;
 
-       
        void saveState();
        void loadState(std::string filename);
        void loadContours( FILE *pFile, bool staticContour );
-
        void saveFileWithContours( std::string filename );
        void onLoadContours(std::string fileNameContourROI);
 
        int inredo;
        int inundo;
        std::string     stundoredo;
-
-
        static char COPY;
 
 //CMRU 17-08-09-----------------------------------------------------------------------------------------------