Image overlay using transparency: I only want to apply the colour displacement map to a selected rectangle of my medical image (area of interest). Can this be done?
2 views (last 30 days)
Show older comments
I am doing a medical image registration looking at displacement off tissue. I have completed image overlay using transparency. I have cropped out a certain area for the colour map to be applied on the area of interest of my medical image.
Problem: The colour map at this area of interest does not show much variation in colour due to the fact that the other areas of the colour map (not displayed) have large colour variety. Is there anyway I can apply this imagesc to only the area of interest? I tried changing the scale of the colour map, although it made no difference. I attached an image to show you what I mean.
0 Comments
Answers (2)
Image Analyst
on 7 Sep 2015
I'm not sure I understand. But why don't you just convert everything to RGB images and assign the proper rectangular region a nice color image that you like?
0 Comments
Walter Roberson
on 8 Sep 2015
Extract the minimum and maximum of your region of interest, and use the result with caxis()
Note: for this to not distort the color of anything outside your ROI, the area outside your ROI will need to be in a different axes than you are applying the colormap to (works in R2014b and later only), or the area outside the ROI must be converted to RGB. For example
ImageAsRGB = repmat(YourIntensityImage, [1, 1, 3]);
image(ImageAsRGB);
hold on
alphamask = double(ROIMask); %ROIMask should be true (1) for the pixels inside the ROI, false (0) otherwise
image(YourIntensityImage, 'alphadata', alphamask);
data_inside_ROI = YourIntensityImage(ROIMask);
minval = min(data_inside_ROI);
maxval = max(data_inside_ROI);
caxis([minval, maxval]);
colormap(AnAppropriateColormap);
colorbar(); %if you want
0 Comments
See Also
Categories
Find more on Geometric Transformation and Image Registration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!