Update content in sliceViewer without creating new sliceviewer object in parent uipanel (appdesigner)

10 ビュー (過去 30 日間)
Watch out, I might be justing wrong 'object' terminology - sorry!
I'm using appdesigner and an uipanel container where I want to use sliceViewer(). I create my sliceViewer in a function call (from a button press) and plot the data as
sliceViewer(data,'Parent',app.UIPanel)
This creates a sliceViewer object and shows the data as I want it to. However, after changing the data I want to plot new data in the same sliceViewer, so I use the same line again with updated data. It looks to me as this creates an additional sliceViewer object on top of the last one as I can see overlapping slice numbers like '10/100' overlapped with '27/120'. If possible I would like to write new data to the existing sliceViewer object but I don't know how to. I've tried using handles to the sliceViewer as 'Parent' but I'm getting error messages saying sliceViewer only accepts uipanels or uifigures as parents.
Alternetavley, I've tried to access the children of 'app.UIPanel' using 'allchild(app.UIPanel)' or 'findobj(app.UIPanel)' with different variations to be able to delete the existing sliceViewer, but I can't get that to work either. The closest I get is when I try to delete all children (only the sliceViewer object) using 'delete(findobj(app.UIPanel))' which deletes the entire panel. Here I could re-make the panel again, but this seems like a horrible solution.

採用された回答

Eric Delgado
Eric Delgado 2022 年 10 月 23 日
Wow @Linus Olofsson... this plot visualization is super weird. It seems impossible to update it! A possible solution is to create your own "sliceViewer". See app attached!
  1 件のコメント
Linus Olofsson
Linus Olofsson 2022 年 10 月 23 日
That is a bit surprising to hear! I'm already making my own slice viewer equivalent in other parts of the app to be able to use things like imshowpair but that involves manually calculating each slice I want to view, which for my application is a bit of a drag. Maybe I need to stick to making my own, much less user-friendly, slice viewer 😅

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by