How to show all voxels properly with 3D matrix data using volshow()??

8 vues (au cours des 30 derniers jours)
SEO BOIL
SEO BOIL le 26 Jan 2022
Réponse apportée : Moksh le 29 Sep 2023
I try to show image with voxels (150x150x150 arrays) using volshow().
Arrays consits of only 0 or 1 value which means different material region for each others.
The regions corresponded to 0 aren't showed well in images created by volshow().
Please give me some advice to treat that problem!!

Réponses (1)

Moksh
Moksh le 29 Sep 2023
Hi SEO BOIL,
I understand that you are trying to visualize image voxels using the “volshow” function in MATLAB, but the areas marked with “0” in the matrix are not shown properly.
You can try the following steps for improving the output:
  • Consider mapping the values in the matrix from “0” and “1” to a wider range of values to enhance the visibility of voxel regions corresponding to 0. For example, you can set the values corresponding to 0 to some negative values or a small positive value and see if this creates a more visible difference in the output.
  • You can try using a custom “Colormap” in the “volshow” function that may help in improving the contrast of the output image.
Kindly refer to the following code snippet on how to use a custom colormap with the “volshow” function in MATLAB:
% Random voxel data
voxels = randi([0, 1], [150, 150, 150]);
customColormap = [0 0 0; 0 1 1]; % Black for 0, Cyan for 1
volshow(voxels, 'Colormap', customColormap);
For more information about the “volshow” function, please refer to the following documentation:
I hope this information helps in resolving the issue you are facing.
Best Regards,
Moksh Aggarwal

Community Treasure Hunt

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

Start Hunting!

Translated by