I have a binary 3d matrix that is meant to represent a 3d object (that is, with the "1"s as voxels that are part of that object, and the "0"s as voxels of empty space). How can I visualize that object, using Matlab?
Asked
Active
Viewed 126 times
1 Answers
1
This answer applies for MATLAB:
You can use the binaryTensorVoxel
function from File Exchange.
Description:
A binary tensor may also be referred to as a 3D matrix of zeros and non-zeros or a 3D logical array.
binaryTensorVoxel
will draw cubes where there are non-zero entries in a tensor and leave vacancies where there are zeros.
Example:
t(:, :, 1) = [1 0 0; 0 0 0; 0 0 1];
t(:, :, 2) = [0 0 0; 0 1 0; 0 0 0];
t(:, :, 3) = [1 0 0; 0 0 0; 0 0 1];
binaryTensorVoxel(t);
axis equal;
grid on;
box on;
This is the result:

codeaviator
- 2,545
- 17
- 42