Hello,
I would like to display a 3D volshow object in App Designer, but in previous answers I have read that volshow does not support uipanels when they are placed on uifigures (such as the canvas in App Designer).
Is there another way I could display a volume? Said volume has been created using cat().
Thank you.

 Réponse acceptée

millercommamatt
millercommamatt le 14 Déc 2022

0 votes

The parent for volshow has to be a Viewer3D object. The parent of a Viewer3D object can be a Figure object (default) | Panel object | GridLayout object | Tab object.
So, create the viewer3d object in your app and then specify that as the parent when you create the volshow object.

5 commentaires

Thank you very much for your answer.
This is what I have done:
viewer=viewer3d(app.Panel);
V=volshow(vol,Parent=viewer);
But I got the following error:
Undefined function 'viewer3d' for input arguments of type 'matlab.ui.container.Panel'.
I created Panel by dragging it from the Component Library in App Desginer.
Digging into this more, I note that viewer3d is new in 2022b. Prior to that you would give volshow that uipanel handle as the parent.
This works in 2021b
fh = uifigure;
ph=uipanel(fh,'Title','3d Viewer');
vsh=volshow(rand(5,5,5),"Parent",ph);
María Pérez Fernández
María Pérez Fernández le 15 Déc 2022
Yes that worked for me!! Thank you really much!
Elvis Pandzic
Elvis Pandzic le 12 Jan 2023
Hi,
I am trying to do a similar thing within App Designer, but is there a way to pass the app.UIFigure as parent of viewer3D? I am trying to use volshow to display volumetric data in defined axes (app.UIAxes) that I placed in my app I am building using App Designer, and that seems to fail...I am using 2022b. Thanks in advance for any guidance you can provide...
Mario Malic
Mario Malic le 12 Jan 2023
As written above: The parent of a Viewer3D object can be a Figure object (default) | Panel object | GridLayout object | Tab object.
Also, in another comment above, there's an example of setting parent to the Viewer3D object.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by