MATLAB: How to built a 3D binary volume array from set of X,Y,Z coordinates

3d volume array

Best Answer

Still not 100% sure what you are looking for, but you said you want to display your scattered points as a solid, so that leads me to believe this would be a step in the right direction.
%%Your points
x=Node_X;
y=Node_Y;
z=Node_Z;
%%3d grid
[X,Y,Z]=meshgrid(min(x):1:max(x),min(y):1:max(y),min(z):1:max(z));
%%3d boundary
tri = delaunayn([x y z]);
%%find points inside of 3d boundary
tn = tsearchn([x y z], tri, [X(:) Y(:) Z(:)]);
IsInside = ~isnan(tn)
%%build volumetric image
I=logical(zeros(size(X)));
I(IsInside)=true;
You can change the image resolution by adjusting the number of points in your grid. Even with a step-size of one unit, the code runs very slow.
Here's a faster way to look at your data as a shell
k=boundary([x,y,z])
trisurf(k,x,y,z)
The left figure displays a shell and the right figure displays a slice of the stacked image I.