File Exchange

image thumbnail

Overlay two datasets or indexed images

version (5.04 KB) by Jochen Rau
Overlay of two datasets: independent colormaps, datatip inspection and alterable after creation.


Updated 08 Dec 2010

View Version History

View License

If you want to show two 2D datasets as images above each other you might find this class useful.

You can define the range of values which should be shown. The overlay works with independent colormaps for both images. It can partly be hidden for values within a certain range. The datatip provides coordinates, the value of the pixel in the background and in the overlay dataset.

It's an object oriented approach, so the function call instantiates a Matlab class. The instance persists as long as you keep the reference and it is (interactively) modifiable via functions on the commandline / from m-files, so you can update one of the images, change the range, alpha-value ...
So it's supposed to be easy to use even though it's custimizable afterwards.

Try "help overlayImg" to get you started.

Cite As

Jochen Rau (2021). Overlay two datasets or indexed images (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

cedric uytingco



Jochen Rau

Thanks for the rating! You mention you think the dataformat could be improved. Do you have a suggestion? If so feel free to contact me!

igor kolupaev

Thank you, good job, saving time. Trifle with the format of the data does not change the overall positive impression.

Jochen Rau

Thank you for the idea! It should work now. Take contact if you face any problems.

Justin Fernandes

Would be nice if you had ability to overlay images that were on two different axes. ie, specify x and y axes of each image. For example, i have an optical image of a scene, and another modality image of a local object within that scene. I would like to overlay the second modality image onto the total scene.

Justin Fernandes

Thank you! Works very well. Exactly what I was looking for.

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: overlayVolume, imoverlay

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!