How the change the intensity of the image in the App designer without loading it again and again?
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Rik
2019-11-19
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!