Path: news.mathworks.com!not-for-mail
From: "Sven" <sven.holcombe@gmail.deleteme.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: point cloud generation
Date: Sat, 3 Jan 2009 17:08:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <gjo61h$g9e$1@fred.mathworks.com>
References: <gjemqe$2bq$1@fred.mathworks.com> <gjeqcp$6kj$1@fred.mathworks.com> <7a888811-3ce0-4434-a4ef-5d1edf8806d4@f3g2000vbf.googlegroups.com>
Reply-To: "Sven" <sven.holcombe@gmail.deleteme.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1231002481 16686 172.30.248.37 (3 Jan 2009 17:08:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 3 Jan 2009 17:08:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1326470
Xref: news.mathworks.com comp.soft-sys.matlab:509663


ImageAnalyst <imageanalyst@mailinator.com> wrote in message <7a888811-3ce0-4434-a4ef-5d1edf8806d4@f3g2000vbf.googlegroups.com>...
> maya:
> OK thanks,  it's now clear as mud.  What do you mean by
> "coordinates"?  The index or voxel coordinates of the "point" are
> simply the x,y,z indexes of the array.  If you want "real-world"
> coordinates, such as in millimeters, then you have to convert the
> x,y,z coordinates  or distances into real-world coordinates using a
> spatial calibration that you have done.
> Regards,
> ImageAnalyst

Maya, how about this interpretation of your question:

You have a voxel volume of n x m x p images, where n x m is the size of one slice, and p is the number of slices. You want to know where, in 3d (xyz mm) space, each pixel is located. Is this correct?

To find the coordinate location in the "p" direction (ie, Z direction), you can check the dicominfo() results for that slice. Namely:
di = dicominfo(pthSliceFileName);
xyz = di.ImagePositionPatient;

This xyz variable will now contain the location (in mm) of the corner pixel of your CT slice. Checking the di.PixelSpacing quantity along with the di.Rows and di.Columns can give you the number of pixels and (mm) distance between pixels in the n and m directions.

Does this help you out at all or am I off target?

If you get 3 arrays that specify the X, Y, Z locations (in mm) of each of the indices in the n, m, p directions, you can use ImageAnalyst's suggestion above to link from a pixel index to a real 3d XYZ coordinate.

Cheers,
Sven.