How to overlay color map onto dicom image?
6 views (last 30 days)
Show older comments
I want to overlay color map onto dicom image,
but the size of color map is different from dicom image since the color map had been processed by interp2.
size of color map : 1501*1501
size of dicom image:256*256
0 Comments
Answers (1)
Jayanti
on 8 Jul 2025
Hi Tsai,
Since you want to overlay a colormap onto a DICOM image when their sizes differ, you’ll need to first resize the colormap to match the dimensions of the DICOM image (i.e., 256×256). MATLAB’s imresize function is suitable for this.
So you can read the dicom image, resize colormap to match dicom image size. Then overlay the resized colormap using "imshow" and "alpha" blending.
Please refer to the below code for more details where I have assumed "colorMap" to be colormap and "dicomImg" to be dicom image:
resizedColorMap = imresize(colorMap, size(dicomImg));
imshow(dicomImg, []);
hold on;
h = imshow(resizedColorMap );
set(h, 'AlphaData', 0.5);
title('Simulated Overlay of Colormap on DICOM Image');
Hope this is helpful!
0 Comments
See Also
Categories
Find more on DICOM Format 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!