[Insight-users] straight line intersection

Luis Ibanez luis.ibanez at kitware.com
Fri, 30 Apr 2004 16:16:32 -0400


Hi Yasser,

Option A:

Please take a look at the family of the ParametricPath

http://www.itk.org/Insight/Doxygen/html/classitk_1_1ParametricPath.html

These classes will allow you to 'walk' along a specific
path and compute image indices along the way.

If you use for example the PolyLine (with a single line) you
could use the Path as a trajectory for visiting pixels in the
image and fill them with a different value.


Option B:

You could use a itkTubeSpatialObject with a radius
close to 1 pixel. Then use the SpatialObjectToImageFilter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1SpatialObjectToImageFilter.html

In order to generate a Mask out of this tube.



Note that the Path will be way more efficient since
only the pixels along the line are visited, while in
the case of the tube all the image pixels are visited
and tested for 'Am I inside of the tube ?'.

On the other hand, the tube will allow you to control
the width of the region that you want to set to a
different grayvalue.



Please let us know if you find any problem,


   Thanks



     Luis


----------------------
ITK Learner wrote:

>  
> Hi
>  
> Iam new to itk and want to find out if there is a convenient way to 
> drill a hole in a voxel based image using a line that intersects with it.
>  
> Basically i want to take a binary image, intersect it with a line and 
> convert the neighbourhood of all the voxels that intersect with the line 
> to the background pixel value.
>  
> Urgent help will be greatly appreciated.
>  
> Regards,
>  
> Yasser
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs 
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/hotjobs/hotjobs_mail_signature_footer_textlink/evt=23983/*http://hotjobs.sweepstakes.yahoo.com/careermakeover> 
>