Artefacts in 3D volume visualization with non-isotropic voxels
Show older comments
Hi everyone,
I am trying to visualize a stack of CT images as a 3D volume. The voxels in the stack are non-isotropic: the pixel size in the x (dxu variable in the code below) and y (dyu variable) directions are equal, but the pixel size in the z direction (dzu variable) is different.
I applied a 3D affine transformation using affinetform3d and then displayed the volume. However, depending on the viewing angle, I notice some artefacts in the visualization. Specifically, certain parts of the volume appear to be duplicated or distorted.
I have attached a figure to illustrate the issue. Below is the code I used:
threshold = 0.2;
Vbone(Vbone < threshold) = 0;
alphaMap = linspace(0, 1, 256).^2;
% Define the affine transformation matrix
A = [dxu 0 0 0; 0 dyu 0 0; 0 0 dzu 0; 0 0 0 1];
% Create the affine transformation object
tform = affinetform3d(A);
% Create the 3D viewer
viewer = viewer3d('BackgroundColor', [0 0 0], 'CameraZoom', 1.3);
% Display the volume with the transformation
vol = volshow(Vbone, ...
'Parent', viewer, ...
'Colormap', jet, ...
'Alphamap', alphaMap, ...
'RenderingStyle', 'CinematicRendering', ...
'Transformation', tform);
The figure is attached.
Does anyone have an idea of what might be causing these artefacts? Is there a way to correct the visualization to avoid these distortions?
Thank you in advance for your help!
3 Comments
GMabilleau
on 13 Nov 2025
Tim Jackman
on 10 Jan 2026
I'm glad you were able to workaround this by resampling the volume, but is there any way you could reproduce this with code and data that you could share? I'd like to investigate this, it looks like a bug to me. Simulated data, or data from a documentation example like this:
with code and screenshots for me to compare would be very helpful.
Accepted Answer
More Answers (0)
Categories
Find more on Discrete Data Plots 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!