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

时间:2013-04-24 07:28:51

标签: image matlab dicom

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

在第二个矩阵中,我进行了阈值处理并仅保留了范围(0.6 -1.0)的值。我想叠加两个矩阵 - 图像并将结果显示为图形,这意味着背景为灰色图像并叠加彩色图像(在非零值区域内)。

你可以给我一些帮助吗? 感谢

1 个答案:

答案 0 :(得分:2)

怎么样

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
相关问题