- 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".
Easy question for you geniuses, what is wrong with my input for this matlab function?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ok so I have done a delaunay triangulation on a 3d point cloud.
tri=delaunay(x,y,z);
and graphed it with trisurf(tri,xval,yval,zval)
Now I am trying to run this function: <http://www.mathworks.com/help/techdoc/ref/delaunaytri.convexhull.html>
which is giving me this error:
>> [k V] = convexHull(tri)
Undefined function 'convexHull' for input arguments of type 'double'.
here is my question. What am I doing wrong, and what is the tri array actually mean? It looks like a huge array of numbers. Will the volume calculation in the convexHull function work without having the x,y,z values which are measured in millimeters?
Thank you!!!
0 Kommentare
Akzeptierte Antwort
Sven
am 9 Jul. 2012
Bearbeitet: Sven
am 9 Jul. 2012
I believe you've gotten (understandably) confused with:
delaunay()
and
DelaunayTri()
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:
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Delaunay Triangulation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!