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

조회 수: 4 (최근 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개)

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by