Thread Subject: point cloud generation

Subject: point cloud generation

From: maya

Date: 31 Dec, 2008 02:53:02

Message: 1 of 7

can anybody suggest a method to to fiind the co-ordinates of the points on CT slices
(CT slices contain the intensity values of the points)

Subject: point cloud generation

From: Image Analyst

Date: 31 Dec, 2008 03:54:01

Message: 2 of 7

"maya" <mayaeapen@googlenews.com> wrote in message <gjemqe$2bq$1@fred.mathworks.com>...
> can anybody suggest a method to to fiind the co-ordinates of the points on CT slices
> (CT slices contain the intensity values of the points)
---------------------------------------------------------------------------------
maya:
This will find coordinates of a certain value (88 in this example)
clc;
close all;
% Read in a slice image from MATLAB demo images.
sliceImage = imread('mri.tif');
% Display it.
subplot(1,2,1);
imshow(sliceImage);

% Let's look for values of 88;
valueToLookFor = 88;
[rows columns] = find(sliceImage == valueToLookFor);
% Every index from 1 to length(rows) gives the row and column
% of a pixel that has value of 100 if you look in the rows() array and the columns()
% array in the same index for each.

% Binarize the image and display those values with 100.
binarizedImage = (sliceImage == valueToLookFor);
subplot(1,2,2);
imshow(binarizedImage);

Regards,
ImageAnalyst

Subject: point cloud generation

From: maya

Date: 3 Jan, 2009 02:23:01

Message: 3 of 7

hai,
   Thanks for giving suggestion.I think i was not clear in the question. My work is to
stack up all the the acquired CT slices along one axis and then find the coordinates of
the points on the stacked image.
Thanks in advance
Maya

Subject: point cloud generation

From: ImageAnalyst

Date: 3 Jan, 2009 04:19:19

Message: 4 of 7

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

Subject: point cloud generation

From: Sven

Date: 3 Jan, 2009 17:08:01

Message: 5 of 7

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.

Subject: point cloud generation

From: ImageAnalyst

Date: 3 Jan, 2009 18:42:30

Message: 6 of 7

I wasn't talking about using 3 arrays.

I'm talking about using ONE 3D array where you have 3 indexed
dimensions, one for x, one for y, and one for z. Or you could have
just one 2D array (if you can't fit the whole 3D image into memory at
one time), just so long as you know what the slice number (z index) of
the current slice is. Then the "coordinates of the points" (sic, her
words) are just simply the x,y,z coordinates (units are in pixels,
voxels) or in mm if you can convert the x,y,z into mm. Sven just
paraphrased what I said, so we're in complete agreement. For example
if you have 0.5 mm per pixel, and you're looking at pixel (100, 200,
50) then in millimeters that would be (50, 100, 25). It's as simple
as that. Or it can be. It can get a little more complex if the z
calibration (slice separation) is not the same as the x,y lateral
resolution, plus the fact that you have to image an object of known
dimensions to determine your spatial calibration in all 3 directions,
not to mention partial volume averaging, beam hardening, and
reconstruction artifacts that complicate things. But I doubt maya
needs to worry about any of those latter things yet. You may be able
to read the spatial calibrations out of the header of the (DICOM or
whatever-format) file (if you trust it), or calculate it on your own
using your object of known dimensions (I have seen discrepancies
between the two methods).

Subject: point cloud generation

From: Matt

Date: 3 Jan, 2009 19:01:03

Message: 7 of 7

"maya" <mayaeapen@googlenews.com> wrote in message <gjemqe$2bq$1@fred.mathworks.com>...
> can anybody suggest a method to to fiind the co-ordinates of the points on CT slices
> (CT slices contain the intensity values of the points)

See "help cat" to find out how to stack the slices into a 3D array.

See "help find" and "help ind2sub" to get the image coordinates.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
ct Image Analyst 30 Dec, 2008 22:55:06
thresholding Image Analyst 30 Dec, 2008 22:55:06
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com