I believe you've gotten (understandably) confused with:
and
The first one does a delaunay triangulation and returns the vertices as numerical output.
The second one returns a triangulation object, from which you can do other fun stuff as specified in the DelaunayTri docs (such as convexHull).
If your only goal is to get the convex hull of your points, then you could go directly there with:
k = convhull(x,y,z);
figure, patch(struct('vertices',[x y z],'faces', k),'FaceColor','c')
However I think you're trying to get the volume of this convex hull too, so you can just do:
DT = DelaunayTri(x,y,z);
[k, vol] = DT.convexHull;
And if your original coordinates (x,y,z), are mm coordinates in space, then your vol will also be in mm^3. If your original coordinates are pixel indices of some 3D image you have, then you should either:
- Convert pixel indices into mm coordinates to send to DelaunayTri
- Calculate the volume of 1 3D "voxel". Beware, this will only make sense if your voxels are "isotropic".
Best Answer