MATLAB 2025a Volshow Data and AlphaData Size Error
Show older comments
I have both MATLAB 2024b and 2025a installed on my Windows 10 system. I am using the following codes to generetae 3D images. The size of both the Data volume pdSNRVolumedBCropped and AlphaData volume pdAlphaTissueVolumeCropped are 512x512x548.
viewer = viewer3d(BackgroundColor="white",BackgroundGradient="off", ...
CameraZoom=1.1028622, CameraPosition = [1.0890e+03,-1.2065e+03,-157.0506], ...
CameraUpVector = [-0.087,-0.9957,0.0295], Box=true);
volshow(pdSNRVolumedBCropped, Parent = viewer, ...
DisplayRange = [dSNRScale1 dSNRScale2], AlphaData = pdAlphaTissueVolumeCropped, ...
RenderingStyle = 'VolumeRendering', Colormap = flipud(gray), ...
Transformation = tformDisplay);
The above code works perfectly in MATLAB 2024b. However, it gives the following error in MATLAB 2025a.
Error using images.ui.graphics.Volume/validateData
'AlphaData' must match the size [0 0 0] of 'Data'.
Error in images.ui.graphics.Volume/set.AlphaData
Error in images.ui.graphics.internal.AbstractContainer/set
Error in images.ui.graphics.GraphicsContainer
Error in images.ui.graphics.Volume
Error in volshow (line 30)
obj = images.ui.graphics.Volume(viewer, remainingInputs{:}, 'Data', V);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in VisualizeInjuryWithLabel (line 226)
volshow(pdSNRVolumedBCropped, Parent = viewer, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If I remove the AlphaData argument, then the code does not give any error.
I tried to set AlphaData = pdSNRVolumedBCropped*0 which makes both the Data and AlphaData the same size of 512x512x548. But in that case as well, I am getting the same error.
Accepted Answer
More Answers (0)
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!