Problem in displaying an image with imshow in app designer

6 次查看(过去 30 天)
Hello,
I'm trying to develop my own app to segment a stack of graylevel images. I designed the "AppSegmentation" app with app designer in Matlab 2023a. This app is supposed to load a dataset from the workspace when the user click on the load dataset button, display a slice of the dataset in UIAxes, apply a threshold value from a numeric edit field, display the same slice but after segmentation in the UIAxes_2, display the number of slices in the stack and allow the user to navigate between slice to ensure that the threshold value is correct. When the ok button is pushed, the threshold level and the segmented stack are supposed to be exported in the workspace.
Now, when I run the app, the segmented slice is displayed in UIAxes_2 but the non-segmented slice is not displayed in UIAxes. I cannot spot what is wrong in the code of the app.
Any help/advice would be great.
I have attached the input dataset as a mat file and the app file.
Thanks in advance,
Guillaume

采纳的回答

Kevin Holly
Kevin Holly 2023-9-12
编辑:Kevin Holly 2023-9-12
I looked at your file and experienced the same problem. I was able to switch the parent to app.UIAxes2 and it worked. I ended up deleting app.UIAxes and placing a new UIAxes. This ended up working. See app attached. I had an error loading the data when I first ran your app so I changed the start up function of your Load pushbutton. I also added an icon to the button for fun.
I'm not sure why your original UIAxes was having issues. When exploring, I noticed that it would display a vertical line after imshow was used and then the Visible property was changed to off.
  1 个评论
GMabilleau
GMabilleau 2023-9-13
Thanks Kevin, it works also at my end. The issues observed with the first UIAxes will remain a mystery for me... Don't know whether it is related, but I started the app under R2022b and then the app was automatically updated when opened the first time in R2023a. Maybe something went wrong there.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by