yooyle
yooyle

Reputation: 77

Superimpose images MATLAB(grey with color)

I have two matrices, the first is the ROI from an dicom image (grey scale) and the second is a matrix with values between 0-1.

In the second matrix I did a thresholding and kept only the values of a range (0.6 -1.0). I would like to superimpose the two matrices-images and show the result as an figure, that means background the grey image and superimposed the color image (in the region of non zero values).

Can you provide me with some help? Thanks

Upvotes: 1

Views: 3507

Answers (1)

Shai
Shai

Reputation: 114936

How about

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

Upvotes: 2

Related Questions