I have a 3D binary mask (from a Dicom image) with one object in it.
I want to calculate the total concave surface area and also the total convex surface area of the object in it. For the total convex surface area
, I have used this link, which its code in Matlab is as follows:
FV = isosurface(BW_Img, 0.5); % BW_Img with dimensions 28x23x18
V = FV.vertices;
F = FV.faces;
A = V(F(:, 2), :) - V(F(:, 1), :);
B = V(F(:, 3), :) - V(F(:, 1), :);
C = cross(A, B, 2);
Convex_surf_area_3D = 1/2 * sum(sqrt(sum(C.^2, 2)));
For the total concave surface area
, I have seen this link, but I don't know how to use it (alphaShape
) on the 3D binary mask:
shp = alphaShape(BW_Img);
concave_surf_area_3D = volume(shp); % or : concave_surf_area_3D = surfaceArea(shp);
% Error using alphaShape: The input points must be 2D or 3D coordinates in numpoints-by-ndim format.
If the above code is my answer, How to set its inputs argument for my 3D binary mask?
else, How to compute the total concave surface area
on the 3D binary mask in Matlab?