[Insight-users] Following a straight line through an image

Dirk Boye body at nabla.org
Mon May 3 05:23:55 EDT 2010


Thanks Luis.

As far as i know I'll miss some voxels with the bresenham algorithm.
I need all the voxels and the line length in each voxel
(I am calculating the radiological depth)

A very good algoritm for that is demonstrated in
"Fast calculation of the exact radiological path for a three-dimensional
CT array" Med. Phys. Volume 12, Issue 2, pp. 252-255 (March 1985)
by Robert L. Siddon

Probably I'll implement that algorithm in ITK myself then :)

Cheers,
Dirk


> Hi Dirk,
>
> You may want to try the class : itk::LineIterator.
>
> http://www.itk.org/Doxygen/html/classitk_1_1LineIterator.html
>
> This class walks a Bresenham line through an ND image.
>
> You can get the index at every iteration by calling the method
>
>              GetIndex();
>
> You will need to compute the starting and ending indexes of
> the line. If you have physical coordinates for the starting and
> ending points of the line, then you can convert them to indexes
> by using the image method:
>
>   image->TransformPhysicalPointToIndex( point, index );
>
>
>
>      Regards,
>
>
>           Luis
>
>
> -------------------------------------------------------------------------
> On Fri, Apr 30, 2010 at 4:15 AM, Dirk Boye <body at nabla.org> wrote:
>> Dear list,
>>
>> I'd like to follow a straight line through an image.
>> The starting point of the line is outside the image, the end point is
>> somewhere inside.
>> What I need to know are the pixel indeces the line passed
>> and also the length of the line in each pixel. (this is very important)
>>
>> The image will have anisotropic spacing (like 0.7 x 0.7 x 4)
>>
>> Can i do this with itkPolyLineParametricPath?
>> I couldn't find any example code for that.
>>
>>
>> Thanks,
>> Dirk
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
>



More information about the Insight-users mailing list