Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here

From the image above, assume that it is a 3D image that is of m*n*o size.

Each voxel can only be either 0 or 1. White is 1. Black is 0.

In this 3D environment, there is one cylinder-like structure, but the whole cylinder does not have consistent radius - from one to the other end, the radius changes around. The whole structure (as in "any edge of the structure to the whole thing inside) consists of white voxels or 1 only. All other voxels outside the structure are 0.

Red line is the computed skeleton of the 3D image - this red skeleton line is always right in the middle of the whole structure.

This implies for any particular voxel of the red line, we can draw the blue circle of respective radius for any particular voxel.

The radius or these green lines are what I am looking for.

If we are to compute for the radius of any particular voxel of the red line, how could that be accomplished?

share|cite|improve this question
Would the radius of the largest sphere centered at the red point and entirely contained in the white voxels be what you are looking for? In other words, the distance from the red point to the nearest black voxel. Some related concepts: medial axis, local feature size. – Rahul Jan 27 '12 at 14:46
@Rahul: I don't know the correct technical term for this, but from your comment, I have to say that I am not looking for the distance of any red point to its nearest black voxel. Let's put it this way: I am to place a 2D circle at a perpendicular angle somewhere on the red line, and I am to find the radius of this 2D circle. Does this make things a bit clearer? – Karl Jan 27 '12 at 14:59
@RahulNarain When he says "circle at a perpendicular angle", he probebly means perpedicular to the curve's tangent vector. – Christian Rau Jan 27 '12 at 16:28
@Christian: Ah, the phrase "at a perpendicular angle" wasn't there when I started writing my reply (now deleted). – Rahul Jan 27 '12 at 16:37
up vote 1 down vote accepted

Well, a first idea might be to take this discrete voxel-curve and make it a continuous curve. This can be achieved by interpolating or approximating it by a spline curve (maybe better to approximate, as the discrete curve is likely to be very "jaggy" and you don't want this high frequency noise in your curve).

From this curve you can then easily compute its tangent vector at a particular point on the curve. So you can compute the normal plane (plane perpendicular to curve, i.e. with curve tangent as normal) at this point. This plane can then be intersected with the voxel set. Maybe by taking all the voxels that intersect the plane or only those, whose two resulting halfs have rather equal size. Or even better, taking all voxels whose distance to the plane lies under a certain maximum (maybe half the size of a single voxel or something around that order of magnitude).

You could then compute the boundary of this slice by projecting all the voxel positions into the plane and computing their convex hull inside this plane (assuming a rather convex slice). Or you simply take only the boundary voxels (determinable by a simple check of their 6-neighbours) and project their positions into the plane. In the end you have a bunch of boundary points inside this perpendicular plane. You can then simply take the average (or maybe minimum) of their distances to the center (the curve point or voxel), assuming rather circle-like slices. Or you could employ more sophisticated things, like PCA or approximation by a circle.

Of course the accuracy of this whole method is highly sensitive to the resolution of the voxelization, but so is any voxel-based method.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.