From c846b7b5b56211997d1af06f17a49f40f4b948fd Mon Sep 17 00:00:00 2001
From: Yoann Guilhem <yoann.guilhem@esrf.fr>
Date: Mon, 3 Jun 2013 17:49:04 +0200
Subject: [PATCH] Continue to fix color map in Segmentation GUI (Ticket 17).

Signed-off-by: Yoann Guilhem <yoann.guilhem@esrf.fr>
---
 5_reconstruction/GtGuiThresholdGrain.m  | 5 ++++-
 5_reconstruction/GtGuiThresholdVolume.m | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/5_reconstruction/GtGuiThresholdGrain.m b/5_reconstruction/GtGuiThresholdGrain.m
index 768fbfaf..cd73c78f 100644
--- a/5_reconstruction/GtGuiThresholdGrain.m
+++ b/5_reconstruction/GtGuiThresholdGrain.m
@@ -12,7 +12,9 @@ classdef GtGuiThresholdGrain < GtVolView
         function obj = GtGuiThresholdGrain(vol, varargin)
             viewer_args = varargin;
             viewer_args(end+1:end+2) = {'f_title', 'Volume Segmentation'};
-            viewer_args(end+1:end+2) = {'cmap', 'constant(64)'};
+            if ~(ismember('cmap', viewer_args(1:2:end)))
+                viewer_args(end+1:end+2) = {'cmap', 'constant(64)'};
+            end
             viewer_args(end+1:end+2) = {'overlay', vol};
 
             obj = obj@GtVolView(vol, viewer_args{:});
@@ -39,6 +41,7 @@ classdef GtGuiThresholdGrain < GtVolView
     methods (Access = protected)
         function setConfigInvariants(obj)
             setConfigInvariants@GtVolView(obj);
+            obj.conf.transparency = 0.4;
 
             obj.min_threshold = min(obj.conf.vol(:));
             obj.max_threshold = max(obj.conf.vol(:));
diff --git a/5_reconstruction/GtGuiThresholdVolume.m b/5_reconstruction/GtGuiThresholdVolume.m
index ff02eadf..03ee0ecc 100644
--- a/5_reconstruction/GtGuiThresholdVolume.m
+++ b/5_reconstruction/GtGuiThresholdVolume.m
@@ -4,6 +4,7 @@ classdef GtGuiThresholdVolume < GtGuiThresholdGrain
 
     methods (Access = public)
         function obj = GtGuiThresholdVolume(vol, varargin)
+            varargin(end+1:end+2) = {'cmap', 'constant(1)'};
             obj = obj@GtGuiThresholdGrain(vol, varargin{:});
 
             obj.setSegmentFunction(@(thr, morph)segmentVolume(obj, thr, morph));
-- 
GitLab