How the change the intensity of the image in the App designer without loading it again and again?

2 visualizaciones (últimos 30 días)
Hello Everyone,
I am new to the Matlab and I am creating an app which reads an image and you have sliders to select the intensity of the image.
Right now, I am doing this as:
function MinSliderValueChanged(app, event)
min=app.MinSlider.Value;
max=app.MaxSlider.Value;
Y=app.File_Path;
Loaded_Image=imread(Y);
if(min>=max)
f = errordlg('Min cannot be greater than Max!','Error');
else
imshow(Loaded_Image,[min,max],'Parent',app.UIAxes);
end
colormap(app.UIAxes,"jet");
colorbar(app.UIAxes);
end
In this way, I am displaying the image again and again and is slow in case of large files. Is there any work around this?
Thanks a lot.

Respuestas (1)

Rik
Rik el 19 de Nov. de 2019
This sounds like you should be able to borrow a lot of code from my WindowLevel FEX submission. The point is to change the caxes, instead of recreating the entire image.
It is always a good idea to create graphics objects only once in your GUI and handle any further modification through the properties of the underlying objects. So in the case of imshow you should be using the image object it returns.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by