Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CanlabCore/fmridisplay_helper_functions/render_blobs.m
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@
%w = repmat(Z, [1 1 3]);

w = map_function(Z,cmaprange(1),cmaprange(2),1,size(cm,1));
w(isnan(w)) = 1; % replace NaN indices (from NaN Z values) with 1 to avoid indexing errors
slicecdat = reshape(cm(round(w),:),[size(Z),3]);
else
w = repmat(Z, [1 1 3]);
Expand Down Expand Up @@ -950,8 +951,8 @@
function val = map_function(c,x1,x2,y1,y2)
if x2 == x1
% this occurs when we have a single value. We arbitrarily set it to
% the middle value
range_val = (y2-y1)/2;
% the middle value. Use ones(size(c)) to preserve the shape of c.
range_val = (y2-y1)/2 * ones(size(c));
else
% softmax here keeps negative values from extending below the colormap
% range, which would otherwise make those values gray, since the lowest
Expand Down