patch_area

From a patch representing a thresholded volume, return area and 2D center along the long
3K Downloads
Updated 10 Aug 2010

View License

This function is provided to extract geometric properties of a volume array that has been thresholded and characterized by a patch (of triangular faces) generated by isosurface(). Its purpose is to calculate the area of a nerve cell dendrite, and also locate its center, both described as a function of distance along the long axis.

The user must choose a long direction (axis) for the process; default is 1 (y). The patch is analyzed in terms of 2D pixel layers perpendicular to this axis.

Algorithm: the surface area of each triangle in the patch is calculated and weighted by the two non-axis coordinates of its centroid; these values are summed in the provisional center of mass array, with the long axis coordinate corresponding to the (rounded) long axis coordinate of the centroid. Triangle areas are summed in the area array corresponding to the axis coordinate of each triangle centroid. After all triangles have been analyzed, the center of mass array is normalized by dividing by the total area in each axis layer, resulting in a net center of mass for the 2D layer.

Triangle areas are calculated from a version of Heron’s formula that has been optimized for numerical stability.

% Sample invocation. 3D array ddr represents a dendrite segment.
thr = graythresh(ddr);
p1 = patch(isosurface(ddr, thr));
[area cm] = patch_area(p1,1);

Please reference the following article if this code is used for your published data analysis:
Ballou, E. W., W. B. Smith, et al. (2006). "Measuring dendritic distribution of membrane proteins." Journal of Neuroscience Methods 156(1-2): 257-266.

Cite As

Ted Ballou (2024). patch_area (https://www.mathworks.com/matlabcentral/fileexchange/8810-patch_area), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.4.0.0

add citation

1.0.0.0

Clarify the usage and algorithm