]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
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;
 }