From: Eduardo DAVILA Date: Wed, 5 Apr 2017 21:05:41 +0000 (+0200) Subject: #3086 creaMaracasVisu Bug New Normal - Init opacity in ColorLayer box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b90d2dce776b27c95bd59251ee83d10a42b0cae5;p=creaMaracasVisu.git #3086 creaMaracasVisu Bug New Normal - Init opacity in ColorLayer box --- diff --git a/bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx b/bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx index 9b1d438..483943e 100644 --- a/bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx +++ b/bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx @@ -45,15 +45,15 @@ void ColorLayerImageView::Process() if (firsttime==true) { - firsttime=false; +// firsttime=false; clivp->SetActive( bbGetInputActive() ); } - clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 0 , bbGetInputWxVtkBaseView() ); clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 1 , bbGetInputWxVtkBaseView1() ); clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 2 , bbGetInputWxVtkBaseView2() ); + std::vector range = bbGetInputlstRangeForColorBar(); clivp->GetColorLayerImageViewManager()->SetRangeForColorBar( range ); @@ -78,16 +78,11 @@ void ColorLayerImageView::Process() bbSetOutputNewImage( clivp->GetColorLayerImageViewManager()->GetImageChangeInformation(0) ); - - -// std::string msg; -// if (bbGetInputTitle()!="") -// { -// msg = bbGetInputTitle()+": " + bbGetInputIn(); -// }else{ -// msg = bbGetInputIn(); -// } -// ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) ); + if (firsttime==true) + { + firsttime=false; + clivp->ChangeOpacity(); + } } //===== diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewManager.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewManager.h index b086e9e..f5c9c4c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewManager.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewManager.h @@ -75,7 +75,7 @@ class ColorLayerImageViewManager void GetSpcBase (int id,double *spc); void GetDimensionOriginalLayer (int id,int *dim); void GetSpcOriginalLayer (int id,double *spc); - void SetNewSpacingLayer(double *spc); + void SetNewSpacingLayer (double *spc); private: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx index 586ea0d..ce2da48 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx @@ -462,13 +462,22 @@ void ColorLayerImageViewPanel::onSliceImage(wxScrollEvent& event) } //---------------------------------------------------------------------------- -void ColorLayerImageViewPanel::onChangeOpacity(wxScrollEvent& event) +void ColorLayerImageViewPanel::ChangeOpacity() { int opacity = _opacity->GetValue(); _colorLayerImageViewManager->onThresholdChangeOpacity(opacity); RefreshView(); } +//---------------------------------------------------------------------------- +void ColorLayerImageViewPanel::onChangeOpacity(wxScrollEvent& event) +{ + ChangeOpacity(); +// int opacity = _opacity->GetValue(); +// _colorLayerImageViewManager->onThresholdChangeOpacity(opacity); +// RefreshView(); +} + //---------------------------------------------------------------------------- bool ColorLayerImageViewPanel::IsVisible() diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h index 00b7f4c..abdefc1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h @@ -75,6 +75,7 @@ class ColorLayerImageViewPanel ColorLayerImageViewPanel(wxWindow * parent, int min, int max,int opacity, int type); ~ColorLayerImageViewPanel(); void onThresholdStop(); + void ChangeOpacity(); ColorLayerImageViewManager* GetColorLayerImageViewManager(); //EED01 ColorLayerImageView* GetColorLayerImageView(); //EED01 void SetColorLayerImageView(ColorLayerImageView* colorLayerImageView);