GETCLIM: Suggest appropriate values for colormap limits

版本 1.3.0.0 (1.8 KB) 作者: Andrew Davis
Determines thresholds such that 2% of data values will be mapped to the extremes of the colormap
260.0 次下载
更新时间 2013/2/4

查看许可证

getclim determines threshold values such that 2% (by default) of
values at the top and bottom of the data range will be mapped
to the extremes of the colormap.

For datasets with a few outliers that influence the range, getclim
is superior to the default behaviour of using the min and max
of the dataset.

Usage: threshVals = getclim(imdata, dataFraction)

imdata: numeric array representing an image to be displayed
dataFraction: fraction of voxels to clip at each end (default 0.02)

threshVals: column vector of values to use for clims in imshow

Example:
I = peaks(200);
min(I(:)), max(I(:)) % -6.5487, 8.1059
threshVals = getclim(I) % -4.2936, 5.8228
I2 = I;
I2(153,106) = 3*I(153,106);
min(I2(:)), max(I2(:)) % -6.5487, 23.5936
threshVals = getclim(I2) % -4.2936, 5.8228
figure
subplot(2,2,1), imshow(I, []), title('I')
subplot(2,2,2), imshow(I, threshVals), title('I+getclim')
subplot(2,2,3), imshow(I2, []), title('I2')
subplot(2,2,4), imshow(I2, threshVals), title('I2+getclim')

See also STRECHLIM, IMADJUST

引用格式

Andrew Davis (2024). GETCLIM: Suggest appropriate values for colormap limits (https://www.mathworks.com/matlabcentral/fileexchange/40102-getclim-suggest-appropriate-values-for-colormap-limits), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.3.0.0

Output a single vector as per Jurgen's suggestion

1.0.0.0