Prev: Using outputfcn for ode15i with length(tspan) > 2
Next: Fitting Beta/Triangular Distribution Using Generalized Pareto Distribution
From: Israel Johnson on 26 Mar 2010 04:49 I have a 3D binary matrix. The ones form a complete cluster within a sea of zeros. I need to find the surface area of the cluster. My initial plan was to use regionprops(M(:,:,i),'Perimeter') for all of the slices i=1:n and then multiply by the distance between the slices (rough but good enough). However it seems that when I put the perimeter function in a loop that it only tracks the final slice. There should be a better way. Summing triangles w/ vertices? But I really have no idea how to tackle that either. Any help. Thanks
From: us on 26 Mar 2010 04:58 "Israel Johnson" <mconverse85(a)gmail.com> wrote in message <hohse0$mns$1(a)fred.mathworks.com>... > I have a 3D binary matrix. The ones form a complete cluster within a sea of zeros. I need to find the surface area of the cluster. My initial plan was to use regionprops(M(:,:,i),'Perimeter') for all of the slices i=1:n and then multiply by the distance between the slices (rough but good enough). However it seems that when I put the perimeter function in a loop that it only tracks the final slice. > > There should be a better way. Summing triangles w/ vertices? But I really have no idea how to tackle that either. Any help. Thanks a hint: help convhulln; us
From: Israel Johnson on 26 Mar 2010 14:41 "us " <us(a)neurol.unizh.ch> wrote in message <hohsus$172$1(a)fred.mathworks.com>... > "Israel Johnson" <mconverse85(a)gmail.com> wrote in message <hohse0$mns$1(a)fred.mathworks.com>... > > I have a 3D binary matrix. The ones form a complete cluster within a sea of zeros. I need to find the surface area of the cluster. My initial plan was to use regionprops(M(:,:,i),'Perimeter') for all of the slices i=1:n and then multiply by the distance between the slices (rough but good enough). However it seems that when I put the perimeter function in a loop that it only tracks the final slice. > > > > There should be a better way. Summing triangles w/ vertices? But I really have no idea how to tackle that either. Any help. Thanks > > a hint: > > help convhulln; > > us My cluster of ones has is almost a tree with branches. I don't want the high surface area of all of those branches to get cut off. It appears to me that the convex hull will do exactly that. Am I mistaken? If not, are there other options?
From: Matt J on 26 Mar 2010 15:05 "Israel Johnson" <mconverse85(a)gmail.com> wrote in message <hohse0$mns$1(a)fred.mathworks.com>... > I have a 3D binary matrix. The ones form a complete cluster within a sea of zeros. I need to find the surface area of the cluster. ============= How are you defining surface area, or for that matter, how are you defining the surface? This is a discrete cluster, so there is any number of continuous surfaces that could be drawn around them.
From: Matt J on 26 Mar 2010 15:23
However it seems that when I put the perimeter function in a loop that it only tracks the final slice. ====== We'll probably need a better explanation of this. If you're passing each slice M(:,:i) to regionpropos() you surely are getting a result for each slice (not just the last one). |