0

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?

  • Possible duplicate of [Plotting volumetric data in MATLAB](http://stackoverflow.com/questions/27659632/plotting-volumetric-data-in-matlab) – Ander Biguri Feb 03 '17 at 14:16

1 Answers1

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:

Voxels

codeaviator
  • 2,545
  • 17
  • 42