I am trying to display 2 overlaid images in an app within a UIAxes.
I know about imshowpair(bg,fg,'blend')
, and although it does work, it doesn't allow me to control the transparency level.
I tried following Steve's tip, where he recommends using:
f1 = imshow(fig1);
f2 = imshow(fig2);
set(f2,'AlphaData',alpha)
but it doesn't work properly within a UIAxes. When I set the 'AlphaData'
property, both images become transparent.
How can I do this? The idea would be to have a slider where the user can set the transparency of the top image interactively.
Reference code and images
f1 = imshow(ref,'Parent',app.UIAxes);
hold on
f2 = imshow(gbT2,'Parent',app.UIAxes);
hold off
set(f2,'AlphaData', alpha);
How it looks in a figure vs how it looks in UIAxes: