How the change the intensity of the image in the App designer without loading it again and again?
2 ビュー (過去 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!