From: Romulo Pinho Date: Wed, 18 Apr 2012 14:11:27 +0000 (+0200) Subject: image fusion now display colour legend too X-Git-Tag: v1.3.0~52^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1d97c744a9d7726cbd8c64ee22b17d10c3820d3e;p=clitk.git image fusion now display colour legend too - even the alpha threshold --- diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index d2a6ba7..714d3d9 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -1241,8 +1241,14 @@ double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, doubl //---------------------------------------------------------------------------- void vvSlicer::Render() { - if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion) { + if (this->mFusion) { + legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable()); + legend->UseOpacityOn(); + legend->SetVisibility(1); + } + else if (this->GetWindowLevel()->GetLookupTable()) {// && !this->mOverlay && !this->mFusion) { legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable()); + legend->UseOpacityOff(); legend->SetVisibility(1); } else legend->SetVisibility(0); diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index d9ed42e..2373aba 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -1236,15 +1236,17 @@ void vvSlicerManager::SetColorMap(int colormap) double v[4]; // set color table transparency + double alpha_range=(double)mFusionThresOpacity/10; double range_end = frange[0] + (double)mFusionThresOpacity*(frange[1] - frange[0])/100; - double curr_value = frange[0]; + double curr_value = fusRange[0]; int nvalues = fusLUT->GetNumberOfTableValues(); - //for (double i = frange[0]; i <= alpha_range_end; i++) { for (double i = 0; curr_value < range_end; i++) { fusLUT->GetTableValue(i, v); v[3] = 0; + //if (curr_value >= -alpha_range && curr_value <= alpha_range) v[3] = pow(fabs(curr_value/alpha_range),2); + //else v[3] = 1; fusLUT->SetTableValue(i, v); - curr_value += (frange[1] - frange[0])/nvalues; + curr_value += (fusRange[1] - fusRange[0])/nvalues; } } for ( unsigned int i = 0; i < mSlicers.size(); i++) {