Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!z1g2000yqn.googlegroups.com!not-for-mail
From: trancemissionxxi@gmail.com
Newsgroups: comp.soft-sys.matlab
Subject: Re: Fit sphere to planar circles
Date: Wed, 8 Apr 2009 01:12:21 -0700 (PDT)
Organization: http://groups.google.com
Lines: 55
Message-ID: <c91073f0-2621-4779-b9a0-b2d3ad8083d2@z1g2000yqn.googlegroups.com>
References: <grgcp1$nkr$1@fred.mathworks.com>
NNTP-Posting-Host: 75.85.174.166
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1239178341 19860 127.0.0.1 (8 Apr 2009 08:12:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 8 Apr 2009 08:12:21 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: z1g2000yqn.googlegroups.com; posting-host=75.85.174.166; 
	posting-account=Kqjb0woAAAAxjqdOxiaFJ1n668MGuCdt
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) 
	Gecko/2009032609 Firefox/3.0.8,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:531289


On Apr 7, 1:24=A0pm, "Sven" <sven.holco...@gmail.deleteme.com> wrote:
> Hi all,
>
> I'm trying to find the center and radius of a mostly spherical body in a =
voxel volume (femoral head in a CT scan, to be precise).
>
> My approach so far has been to use hough circle detection in the area of =
interest, looped over each slice. This detection works best around the hemi=
sphere (rather than pole) regions of the sphere, and I am using some logic =
to cull away any false positive circles detected by the hough transform.
>
> My question is this: what is the best way to fit a sphere to a series of =
planar circles?
>
> My data is currently in the form of:
> circs =3D [...
> =A0 240.5275 =A0145.0197 -564.5000 =A0 20.5078;
> =A0 241.1135 =A0146.1915 -559.5000 =A0 22.8516;
> =A0 241.1135 =A0146.1915 -554.5000 =A0 23.4375;
> =A0 241.6994 =A0146.7775 -549.5000 =A0 23.4375;
> =A0 241.1135 =A0146.7775 -544.5000 =A0 22.2656;]
>
> The columns are the X, Y, and Z locations of 5 circle origins, and their =
radii.
>
> I'm confident that the average of the X and Y columns represent the X and=
 Y sphere centre, but I don't know the best way to get the Z location.
>
> A simple average of Z locations is inaccurate because the detected circle=
s are not necessarily centrally detected along the Z-direction.
>
> Any thoughts? Perhaps I could try to fit a curve to the radii values and =
find its peak, but I'm not sure how to fit anything robustly to so few data=
 points.
>
> Any help would be very welcome.
> Thanks,
> Sven.

Sven,

I have a similar problem and I abandoned the hough transform. I assume
you have grayscale images. What I do is replicate slices to bring z
resolution ~equal to xy resolution, then I do a fft convolution with a
spherical mask (there is an fspecial3 on file exchage, you need some
normalization though) at the radius of interest. If you don't know the
radius, you can iterate over multiple radii. Take the pixel
coordinates corresponding to the max of the convolution.

Any thoughts on/need of computing the entropy of the pixels within the
sphere without requiring a supercomputing center? I'm actively
researching this. Let me know if you want to chat more about this.

Thanks,
Trance.