Select Git revision
getClipQuantiles.m
getClipQuantiles.m 487 B
function clipLimits = getClipQuantiles(voxels,nQuant)
mx = mean(voxels);
sx = std(voxels);
cl = [mx-sx, mx+sx];
% if all(voxels<0)
% cl(2) = max(voxels);
% end
% if all(voxels>0)
% cl(1) = min(voxels);
% end
% linear quantization
clipLimits = cl; %linspace(cl(1),cl(2),nQuant);
% % equiprobable quantization
% ep1 = length(find(voxels<=cl(1)))./length(voxels);
% ep2 = 1-length(find(voxels>cl(2)))./length(voxels);
% clipLimits = quantile(voxels,linspace(ep1,ep2,nQuant));
4;