-
Notifications
You must be signed in to change notification settings - Fork 63
Slover: Controling the alpha (transparency) of a "split" type image #7
Copy link
Copy link
Open
Description
I have a brain map with both positive and negative values and I would like to use slover to display it on a structural image.
My idea is to build a 3-layers slover object (layer 1: background, layer 2 & 3 will be the same file).
Layer 2 will be displayed with "hot" colors and layer 3 with "winter".
How can I control the transparency of layer 2 and 3? Both are of type "split" because "truecolour" type will display them too transparent...
My code looks like this:
obj.img(1).vol=spm_vol(structFile);
obj.img(2).vol=spm_vol(NiftiFile);
obj.img(3).vol=spm_vol(NiftiFile);
[mx1 mn1] = slover('volmaxmin', obj.img(1).vol);
[mx mn] = slover('volmaxmin', obj.img(2).vol);
% thresholds for layer 2 and 3
lowerthreshold = 0.05;
upperthreshold = max(abs(mx) , abs(mn)) / 2; % custom max value for nice visualizations
% define color map range
obj.img(1).range = [0 mx1]; % do not display negatives (if any)
obj.img(2).range=[lowerthreshold, upperthreshold]; % make symmetric
obj.img(3).range=[-lowerthreshold, -upperthreshold]; % make symmetric
% define color maps
obj.img(2).cmap='hot';
obj.img(3).cmap='winter';
% transparency and type
obj.img(1).type = 'truecolour';
obj.img(2).type = 'split';
obj.img(3).type = 'split';
paint(obj);
Results using the above code:
Results after setting obj.img(2).type = 'truecolour'; obj.img(3).type = 'truecolour'; obj.img(2).prop = 1; obj.img(3).prop = 1;:

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

