Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 30b7ff4a authored by DIB Elian's avatar DIB Elian
Browse files

Allow zero as a label and color reference

parent 8ddbb2af
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,10 @@ function labels = colorLabels(labels,varargin)
%COLORLABELS Summary of this function goes here
% Detailed explanation goes here
cmap = jet(max(labels(:)));
sz = size(labels);
cmap = jet(max(labels(:))+1);
shuffle = false;
gray = ones(size(labels));
gray = ones(sz);
coldim = 3;
p = inputParser();
......@@ -31,8 +32,8 @@ order = 1:(ndims(gray)+1);
order(coldim) = ndims(gray)+1;
order(ndims(gray)+1) = coldim;
labels = cmap(labels(:),:);
labels = reshape(labels,[size(gray),3]);
labels = cmap(labels(:)+1,:);
labels = reshape(labels,[sz,3]);
labels = permute(labels,order);
labels = labels.*gray;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment