]> Creatis software - creaMaracasVisu.git/commitdiff
#2440 creaMaracasVisu Feature New Normal - Add Active option to the ColorLayer Box
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Tue, 12 Aug 2014 14:31:09 +0000 (16:31 +0200)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Tue, 12 Aug 2014 14:31:09 +0000 (16:31 +0200)
bbtk/src/bbcreaMaracasVisuAddContainerSettings.cxx
bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx
bbtk/src/bbcreaMaracasVisuColorLayerImageView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx

index cadab5d78603934aef451bfc37767cabc9543001..f98873df899b18b78c0a0b7d368d2c7a3c8c5994 100644 (file)
@@ -8,40 +8,48 @@ BBTK_BLACK_BOX_IMPLEMENTATION(AddContainerSettings,bbtk::AtomicBlackBox);
 
 void AddContainerSettings::Process()
 {
-               if(bbGetInputIn1()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn1() );
-               }
-               if(bbGetInputIn2()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn2() );
-               }
-               if(bbGetInputIn3()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn3() );
-               }
-               if(bbGetInputIn4()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn4() );
-               }
-               if(bbGetInputIn5()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn5() );
-               }
-               if(bbGetInputIn6()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn6() );
-               }
-               if(bbGetInputIn7()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn7() );
-               }
-               if(bbGetInputIn8()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn8() );
-               }
-               if(bbGetInputIn9()!=NULL){
-                       m_BCSettingsVector.push_back( bbGetInputIn9() );
-               }
-               bbSetOutputOut( m_BCSettingsVector );
+       m_BCSettingsVector.clear();
+       if(bbGetInputIn1()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn1() );
+       }
+       if(bbGetInputIn2()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn2() );
+       }
+       if(bbGetInputIn3()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn3() );
+       }
+       if(bbGetInputIn4()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn4() );
+       }
+       if(bbGetInputIn5()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn5() );
+       }
+       if(bbGetInputIn6()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn6() );
+       }
+       if(bbGetInputIn7()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn7() );
+       }
+       if(bbGetInputIn8()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn8() );
+       }
+       if(bbGetInputIn9()!=NULL){
+               m_BCSettingsVector.push_back( bbGetInputIn9() );
+       }
+       bbSetOutputOut( m_BCSettingsVector );
 }
 
 void AddContainerSettings::bbUserSetDefaultValues()
 {
-
+       bbSetInputIn1(NULL);
+       bbSetInputIn2(NULL);
+       bbSetInputIn3(NULL);
+       bbSetInputIn4(NULL);
+       bbSetInputIn5(NULL);
+       bbSetInputIn6(NULL);
+       bbSetInputIn7(NULL);
+       bbSetInputIn8(NULL);
+       bbSetInputIn9(NULL);
 }
 
 void AddContainerSettings::bbUserInitializeProcessing()
index 95b040965b3044139c746f51ae8c25dd34b1967e..de5de6edbd97182caa828fc6d789501380f860b3 100644 (file)
@@ -41,10 +41,11 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ColorLayerImageView,bbtk::WxBlackBox);
 //=====
 void ColorLayerImageView::Process()
 {
-printf("ColorLayerImageView::Process start\n");
 
     ColorLayerImageViewPanel *clivp = (ColorLayerImageViewPanel*)bbGetOutputWidget();
 
+    clivp->SetActive( bbGetInputActive() );
+
     clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 0 , bbGetInputWxVtkBaseView() );
     clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 1 , bbGetInputWxVtkBaseView1() );
     clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 2 , bbGetInputWxVtkBaseView2() );
@@ -60,6 +61,8 @@ printf("ColorLayerImageView::Process start\n");
 
     clivp->SetImage( bbGetInputIn() );
 
+
+
 //   std::string msg;
 //    if (bbGetInputTitle()!="")
 //    {
@@ -69,8 +72,6 @@ printf("ColorLayerImageView::Process start\n");
 //    }
 //   ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) );
 
-printf("ColorLayerImageView::Process end\n");
-
 }
 //=====
 // Don't edit this file. This file is generated from xml description..
@@ -86,6 +87,7 @@ void ColorLayerImageView::CreateWidget(wxWindow* parent)
 void ColorLayerImageView::bbUserSetDefaultValues()
 {
     bbSetInputIn(NULL);
+    bbSetInputActive(true);
     bbSetInputWxVtkBaseView(NULL);
     bbSetInputWxVtkBaseView1(NULL);
     bbSetInputWxVtkBaseView2(NULL);
index a7ab2d01c195ff5480e29c305b78758d9bf0f367..e12f2ddbdd4f569633b0b0e1429f909ed958472b 100644 (file)
@@ -45,10 +45,11 @@ class bbcreaMaracasVisu_EXPORT ColorLayerImageView
 //=====
 // Don't edit this file. This file is generated from xml description..
 //=====
+  BBTK_DECLARE_INPUT(In,vtkImageData*);
+  BBTK_DECLARE_INPUT(Active,bool);
   BBTK_DECLARE_INPUT(WxVtkBaseView,wxVtkBaseView *);
   BBTK_DECLARE_INPUT(WxVtkBaseView1,wxVtkBaseView *);
   BBTK_DECLARE_INPUT(WxVtkBaseView2,wxVtkBaseView *);
-  BBTK_DECLARE_INPUT(In,vtkImageData*);
   BBTK_DECLARE_INPUT(lstBaseColor,std::vector<double>);
   BBTK_DECLARE_INPUT(lstGreyLevelBoundaries,std::vector<double>);
   BBTK_DECLARE_INPUT(PlainOrGradientColor,bool);
@@ -64,18 +65,19 @@ class bbcreaMaracasVisu_EXPORT ColorLayerImageView
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColorLayerImageView,bbtk::WxBlackBox);
-BBTK_NAME("ColorLayerImageView");
-BBTK_AUTHOR("Eduardo DAVILA (Creatis)");
-BBTK_DESCRIPTION("Color Layer Image View");
-BBTK_CATEGORY("__CategoryBlackBox__");
-BBTK_INPUT(ColorLayerImageView,WxVtkBaseView," 0 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
-BBTK_INPUT(ColorLayerImageView,WxVtkBaseView1," 1 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
-BBTK_INPUT(ColorLayerImageView,WxVtkBaseView2," 2 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
-BBTK_INPUT(ColorLayerImageView,In,"Input Image",vtkImageData*,"");
-BBTK_INPUT(ColorLayerImageView,lstBaseColor,"List of Base Colors in RGB format to define the color map. Requirement: must be of a size being a multiple of 3, with values between 0 and 1. For example, for 2 colors: \"1 0 0 0 0 1\". If not provided as required, the histogram is equally split into three areas, blue, yellow and red.",std::vector<double>,"");
-BBTK_INPUT(ColorLayerImageView,lstGreyLevelBoundaries,"List of the Grey Level Boundaries to define the color map (grey level outside the color boundaries will not be disayed). Requirement: Must have one more element than the number of colours. For example, for 2 colors: \"50 150 250\". If not provided as required, the histogram is equally split into areas, which number corresponds to the number of colors provided (3 by default).",std::vector<double>,"");
-BBTK_INPUT(ColorLayerImageView,PlainOrGradientColor,"Choose between Plain (true) or Gradient (false) colors. Default is false.",bool,"");
-BBTK_INPUT(ColorLayerImageView,FittingMode,"Choose the fitting mode between the images, the transformation can be either by Dimension (1), by Spacing (2) or by Pixel (3). If you want to make the choice through a dialog box, choose (-1). Default is by Pixel (3).",int,"");
+  BBTK_NAME("ColorLayerImageView");
+  BBTK_AUTHOR("Eduardo DAVILA (Creatis)");
+  BBTK_DESCRIPTION("Color Layer Image View");
+  BBTK_CATEGORY("__CategoryBlackBox__");
+  BBTK_INPUT(ColorLayerImageView,In,"Input Image",vtkImageData*,"");
+  BBTK_INPUT(ColorLayerImageView,Active,"Active True/False (default True)",bool,"");
+  BBTK_INPUT(ColorLayerImageView,WxVtkBaseView," 0 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
+  BBTK_INPUT(ColorLayerImageView,WxVtkBaseView1," 1 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
+  BBTK_INPUT(ColorLayerImageView,WxVtkBaseView2," 2 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
+  BBTK_INPUT(ColorLayerImageView,lstBaseColor,"List of Base Colors in RGB format to define the color map. Requirement: must be of a size being a multiple of 3, with values between 0 and 1. For example, for 2 colors: \"1 0 0 0 0 1\". If not provided as required, the histogram is equally split into three areas, blue, yellow and red.",std::vector<double>,"");
+  BBTK_INPUT(ColorLayerImageView,lstGreyLevelBoundaries,"List of the Grey Level Boundaries to define the color map (grey level outside the color boundaries will not be disayed). Requirement: Must have one more element than the number of colours. For example, for 2 colors: \"50 150 250\". If not provided as required, the histogram is equally split into areas, which number corresponds to the number of colors provided (3 by default).",std::vector<double>,"");
+  BBTK_INPUT(ColorLayerImageView,PlainOrGradientColor,"Choose between Plain (true) or Gradient (false) colors. Default is false.",bool,"");
+  BBTK_INPUT(ColorLayerImageView,FittingMode,"Choose the fitting mode between the images, the transformation can be either by Dimension (1), by Spacing (2) or by Pixel (3). If you want to make the choice through a dialog box, choose (-1). Default is by Pixel (3).",int,"");
 BBTK_END_DESCRIBE_BLACK_BOX(ColorLayerImageView);
 //=====
 // Don't edit this file. This file is generated from xml description..
index 963a51c222ec7ab2c888be502b3a19bc616cfc33..eb38e0966c00663226f01f21cfcd55284522aab8 100644 (file)
@@ -127,28 +127,28 @@ ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, in
 
 
        Connect( _btn_ReadImage->GetId(), wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &ColorLayerImageViewPanel::onReadImage );
-       Connect( _cb_ShowHide->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdShow );
+       Connect( _cb_ShowHide->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED  , (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdShow );
        Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdInterpolation );
        Connect( _opacity->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &ColorLayerImageViewPanel::onChangeOpacity );
        Connect( _cb_SliceFixDinamic->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceFixDinamic );
 
        Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_THUMBTRACK      , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
        Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_LINEUP          , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
-       Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_LINEDOWN                , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+       Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_LINEDOWN        , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
        Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_PAGEUP          , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
-       Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_PAGEDOWN                , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+       Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_PAGEDOWN        , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
 
        Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_THUMBTRACK      , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
        Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_LINEUP          , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
-       Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_LINEDOWN                , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+       Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_LINEDOWN        , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
        Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_PAGEUP          , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
-       Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_PAGEDOWN                , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+       Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_PAGEDOWN        , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
 
        Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_THUMBTRACK      , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
        Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_LINEUP          , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
-       Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_LINEDOWN                , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+       Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_LINEDOWN        , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
        Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_PAGEUP          , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
-       Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_PAGEDOWN                , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+       Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_PAGEDOWN        , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
 
 
 
@@ -307,8 +307,11 @@ void ColorLayerImageViewPanel::SetImage(vtkImageData *img)
 //EED01        if (_colorLayerImageView!=NULL)
 //EED01        {
 //EED01            _colorLayerImageView->onThreshold();
-               _colorLayerImageViewManager->onThreshold();
-               RefreshView();
+               if (_active==true)
+               {
+                   _colorLayerImageViewManager->onThreshold();
+                   RefreshView();
+               }
 //EED01        }
 
 
@@ -471,6 +474,12 @@ bool ColorLayerImageViewPanel::IsVisible()
        return _thresholdGo;
 }
 
+//----------------------------------------------------------------------------
+void ColorLayerImageViewPanel::SetActive(bool active)
+{
+      _active=active;
+      _cb_ShowHide->SetValue( _active );
+}
 
 
 // EOF
index da8489cc6a6e5380598350bb26c16f5a44250132..35a1c49d7704490d465748b76659dd20d6e12b74 100644 (file)
@@ -75,8 +75,10 @@ class ColorLayerImageViewPanel
                        void SetImage(vtkImageData *img);
                        void SetFittingMode(int fitting_mode);
                        int GetFittingMode();
+                       void SetActive(bool active);
 
                private:
+                       bool                            _active;
                        int                             _fitting_mode;
 
                        int                             _dimBase[3];
index c963498c24fd30d45e39f2460f0d868ec6897483..3884a64a55b579db0333aaa0889acf7a77d38997 100644 (file)
@@ -217,14 +217,12 @@ void LayerImageBase::SetImage(vtkImageData* image)
 //----------------------------------------------------------------------------
 void LayerImageBase::SetwxVtkBaseView(wxVtkBaseView *baseview)
 {
-       printf("EED LayerImageBase::SetwxVtkBaseView start baseview:%p \n", baseview);
        if (_baseView==NULL)
        {
          _baseView = baseview;
          vtkInteractorStyleBaseView *isbv    = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView());
          isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) );
        } // if _baseView
-       printf("EED LayerImageBase::SetwxVtkBaseView end \n");
 }
 
 //----------------------------------------------------------------------------
@@ -236,7 +234,6 @@ wxVtkBaseView *LayerImageBase::GetwxVtkBaseView()
 //----------------------------------------------------------------------------
 void LayerImageBase::Refresh()
 {
-    printf("EED LayerImageBase::Refresh\n");
     if (_baseView!=NULL)
     {
         _baseView->Refresh();
@@ -292,9 +289,6 @@ void LayerImageBase::CleanXYZ(double &x, double &y, double &z)
 //----------------------------------------------------------------------------
 void LayerImageBase::onThreshold()
 {
-
-       printf("EED LayerImageBase::onThreshold start \n");
-       
        if ((_image!=NULL) && (_baseView!=NULL))
        {
                double spc[3];
@@ -307,10 +301,6 @@ void LayerImageBase::onThreshold()
                x = x*spc[0];
                y = y*spc[1];
                z = z*spc[2];
-               
-
-       printf("EED LayerImageBase::onThreshold z = %d   spcZ%f\n" , z, spc[2]);
-               
 
                vtkCamera *camera = _baseView->GetRenderer()->GetActiveCamera();
                int directionViewer=0;
@@ -320,9 +310,6 @@ void LayerImageBase::onThreshold()
                        directionViewer =  wxvtk2dbasevie->GetDirection();
                } // ParallelProjection
 
-printf("EED LayerImageBase::onThreshold projection = %d\n" , camera->GetParallelProjection() );
-printf("EED LayerImageBase::onThreshold direction = %d\n" , directionViewer );
-
 
                if (!GetActorPresent())
                {
@@ -395,12 +382,8 @@ printf("EED LayerImageBase::onThreshold direction = %d\n" , directionViewer );
                _thresholdMapper->SetInput( img );
                _thresholdMapper->SetLookupTable( _thresholdTable );
                _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
-
-               printf("EED LayerImageBase::onThreshold working \n");
-               
                
                } // _image
-       printf("EED LayerImageBase::onThreshold end \n");
 }