2013-04-24 103 views
1

我有兩個矩陣,第一個是來自dicom圖像(灰度)的ROI,第二個矩陣的值在0-1之間。疊加圖像MATLAB(帶顏色的灰色)

在第二個矩陣中,我進行了閾值處理,只保留了一個範圍值(0.6 -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