From 16980e837c1cdd50664db8498d7e3b1aac7cf91b Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Fri, 5 Apr 2024 13:19:46 +0200 Subject: [PATCH] #3555 ColorLayer box input Interpolation --- bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx | 1 + bbtk/src/bbcreaMaracasVisuColorLayerImageView.h | 2 ++ bbtk/src/bbcreaMaracasVisuColorLayerImageView2.cxx | 2 ++ bbtk/src/bbcreaMaracasVisuColorLayerImageView2.h | 2 ++ bbtk/src/bbmaracasvisuViewerNV.cxx | 3 +-- .../ThresholdImageView/ColorLayerImageViewPanel.cxx | 13 +++++++++++++ .../ThresholdImageView/ColorLayerImageViewPanel.h | 4 +++- 7 files changed, 24 insertions(+), 3 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx b/bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx index 6fde87a..be7f756 100644 --- a/bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx +++ b/bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx @@ -107,6 +107,7 @@ void ColorLayerImageView::Process() bbSetOutputNewImage( clivp->GetColorLayerImageViewManager()->GetImageChangeInformation(0) ); bbSetOutputLookupTable( clivp->GetColorLayerImageViewManager()->GetLookupTable(0) ); bbSetOutputOutOpacity( clivp->GetOpacity() ); + bbSetOutputInterpolation( clivp->GetInterpolation() ); if (firsttime==true) { firsttime=false; diff --git a/bbtk/src/bbcreaMaracasVisuColorLayerImageView.h b/bbtk/src/bbcreaMaracasVisuColorLayerImageView.h index 8af663f..b3bc2f3 100644 --- a/bbtk/src/bbcreaMaracasVisuColorLayerImageView.h +++ b/bbtk/src/bbcreaMaracasVisuColorLayerImageView.h @@ -64,6 +64,7 @@ class bbcreaMaracasVisu_EXPORT ColorLayerImageView BBTK_DECLARE_OUTPUT(NewImage,vtkImageData*); BBTK_DECLARE_OUTPUT(LookupTable,vtkScalarsToColors*); BBTK_DECLARE_OUTPUT(OutOpacity,int); + BBTK_DECLARE_OUTPUT(Interpolation,bool); BBTK_PROCESS(Process); void Process(); BBTK_CREATE_WIDGET(CreateWidget); @@ -104,6 +105,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColorLayerImageView,bbtk::WxBlackBox); BBTK_OUTPUT(ColorLayerImageView,NewImage,"Image with correct Spacing",vtkImageData*,""); BBTK_OUTPUT(ColorLayerImageView,LookupTable,"LookupTable",vtkScalarsToColors*,""); BBTK_OUTPUT(ColorLayerImageView,OutOpacity,"Opacity",int,""); + BBTK_OUTPUT(ColorLayerImageView,Interpolation,"Interpolation",bool,""); BBTK_END_DESCRIBE_BLACK_BOX(ColorLayerImageView); diff --git a/bbtk/src/bbcreaMaracasVisuColorLayerImageView2.cxx b/bbtk/src/bbcreaMaracasVisuColorLayerImageView2.cxx index aa0941f..692bc2e 100644 --- a/bbtk/src/bbcreaMaracasVisuColorLayerImageView2.cxx +++ b/bbtk/src/bbcreaMaracasVisuColorLayerImageView2.cxx @@ -65,6 +65,7 @@ void ColorLayerImageView2::Process() _colorLayerImageViewManager->SetBaseTransparence ( transparence_level_boundaries ); _colorLayerImageViewManager->SetPlainOrGradientColor ( bbGetInputPlainOrGradientColor() ); _colorLayerImageViewManager->onThresholdChangeOpacity ( bbGetInputOpacity() ); + _colorLayerImageViewManager->onThresholdInterpolation ( bbGetInputInterpolation() ); _colorLayerImageViewManager->SetActive ( bbGetInputActive() ); int fitting_mode=3; @@ -118,6 +119,7 @@ void ColorLayerImageView2::bbUserSetDefaultValues() bbSetInputIn(NULL); bbSetInputActive(true); bbSetInputOpacity(100); + bbSetInputInterpolation(true); bbSetInputPlainOrGradientColor(false); // bbSetInputTypeControlsInterface(1); bbSetInputWxVtkBaseView(NULL); diff --git a/bbtk/src/bbcreaMaracasVisuColorLayerImageView2.h b/bbtk/src/bbcreaMaracasVisuColorLayerImageView2.h index 094833b..6f867e5 100644 --- a/bbtk/src/bbcreaMaracasVisuColorLayerImageView2.h +++ b/bbtk/src/bbcreaMaracasVisuColorLayerImageView2.h @@ -29,6 +29,7 @@ class bbcreaMaracasVisu_EXPORT ColorLayerImageView2 BBTK_DECLARE_INPUT(In,vtkImageData*); BBTK_DECLARE_INPUT(Active,bool); BBTK_DECLARE_INPUT(Opacity,int); + BBTK_DECLARE_INPUT(Interpolation,bool); // BBTK_DECLARE_INPUT(TypeControlsInterface,int); BBTK_DECLARE_INPUT(WxVtkBaseView,wxVtkBaseView *); BBTK_DECLARE_INPUT(WxVtkBaseView1,wxVtkBaseView *); @@ -62,6 +63,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColorLayerImageView2,bbtk::AtomicBlackBox); BBTK_INPUT(ColorLayerImageView2,In,"Input Image",vtkImageData*,""); BBTK_INPUT(ColorLayerImageView2,Active,"Active True/False (default True)",bool,""); BBTK_INPUT(ColorLayerImageView2,Opacity,"(default 100) 0..100",int,""); + BBTK_INPUT(ColorLayerImageView2,Interpolation,"(default true) true/false",bool,""); // BBTK_INPUT(ColorLayerImageView2,TypeControlsInterface,"1 (default) All controls, 2 just transparency",int,""); BBTK_INPUT(ColorLayerImageView2,WxVtkBaseView," 0 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,""); BBTK_INPUT(ColorLayerImageView2,WxVtkBaseView1," 1 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,""); diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index 7191091..86542ad 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -273,6 +273,5 @@ void ViewerNV::updateObservers() } // if interactor } -} -// EO namespace bbcreaMaracasVisu +}// EO namespace bbcreaMaracasVisu diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx index 3d84d07..37df70c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx @@ -124,6 +124,7 @@ ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, in //: wxPanel(parent, -1, wxDefaultPosition, wxSize(600,100), wxBORDER_SUNKEN) : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { + _interpolationCheckBox=NULL; _spcBase[0] = _spcBase[1] = _spcBase[2] = 0; _dimBase[0] = _dimBase[1] = _dimBase[2] = 0; _cb_ShowHide = NULL; @@ -518,6 +519,18 @@ int ColorLayerImageViewPanel::GetOpacity() return _opacity->GetValue(); } +//---------------------------------------------------------------------------- +bool ColorLayerImageViewPanel::GetInterpolation() +{ + if (_interpolationCheckBox!=NULL) + { + return _interpolationCheckBox->GetValue(); + } else { + return false; + } // if _interpolationCheckBox +} + + //---------------------------------------------------------------------------- void ColorLayerImageViewPanel::ChangeOpacity() { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h index 9109345..514071e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h @@ -75,7 +75,9 @@ class ColorLayerImageViewPanel ColorLayerImageViewPanel(wxWindow * parent, int min, int max,int opacity, int type); ~ColorLayerImageViewPanel(); void onThresholdStop(); - int GetOpacity(); + int GetOpacity(); + bool GetInterpolation(); + virtual void ChangeOpacity(); ColorLayerImageViewManager* GetColorLayerImageViewManager(); //EED01 ColorLayerImageView* GetColorLayerImageView(); -- 2.47.1