叠加图像MATLAB(灰色带彩色)



我有两个矩阵,第一个是来自dicom图像(灰度)的ROI,第二个是值在0-1之间的矩阵。

在第二个矩阵中,我做了一个阈值划分,只保留一个范围(0.6 -1.0)的值。我想将这两个矩阵图像叠加,并将结果显示为图形,即背景是灰色图像,叠加的是彩色图像(在非零值区域)。

你能给我提供一些帮助吗?由于

figure;
imshow( first(:,:,[1 1 1]) ); % make the first a grey-scale image with three channels so it will not be affected by the colormap later on
hold on;
t_second = second .* ( second >= .6 & second <= 1.0 ); % threshold second image
ih = imshow( t_second );
set( ih, 'AlphaData', t_second );
colormap jet

最新更新