[Insight-users] warping a clound of points when the target landmarks form a straight line

Nicholas Tustison ntustison at gmail.com
Thu Jul 7 20:29:55 EDT 2011


That's good.  Glad it's working.  

Just an FYI, the latest version of the B-spline code is absent the ability
to evaluate at random points in the domain since it was not really in the
style of itk class divisions which is why there are now three total classes:

itkBSplineControlPointImageFunction
itkBSplineCOntrolPointImageFilter
itkBSplineScatteredDataPointSetToImageFilter

Also, the Evaluate() call forces a call in the range [0,1) as you say but 
the related calls, EvaluateAtPoint(), EvaluateAtIndex(), and EvaulateAtContinuousIndex()
allows you to query points as defined based on the B-spline (i.e. image) domain.

Nick


On Jul 7, 2011, at 8:18 PM, Ramón Casero Cañas wrote:

> On 06/07/11 20:45, Ramón Casero Cañas wrote:
>> 
>> Now I have an image where each voxel is the interpolated value of the
>> warp field.
>> 
>> How can I sample the image at specific points? What I want, in the end,
>> is a function
> 
> 
> OK, I think I have it working now
> 
> http://code.google.com/p/gerardus/source/browse/trunk/matlab/ItkToolbox/ItkPSTransform.cpp
> 
> Following Nick and J.C Gee's example in their Insight Journal paper
> 
> http://hdl.handle.net/1926/140
> 
> it's not necessary to generate the image, and then sample it, as it's possible to sample interpolated points directly from BSplineScatteredDataPointSetToImageFilter.
> 
> There were a couple of tricky bits, for example that all the points (landmarks and points to be warped) must be within a cube [0, 1] x [0, 1] x [0, 1], so they need to be translated and scaled before warping.
> 
> Also, as the image is not generated, there's no need for a size, but the size must be at least 2 voxels in each dimension to avoid a running-time error.
> 
> I have attached an image with the result of warping a 3D set of points from a bent vessel, from the following Matlab script
> 
> http://code.google.com/p/gerardus/source/browse/trunk/matlab/test/test_itk_pstransform.m
> 
> Best regards,
> 
> Ramon.
> 
> -- 
> Dr. Ramón Casero Cañas
> 
> Computational Biology
> Department of Computer Science
> University of Oxford
> Wolfson Building, Parks Rd
> Oxford OX1 3QD
> 
> tlf     +44 (0) 1865 610737
> web     http://web.comlab.ox.ac.uk/people/Ramon.CaseroCanas
> photos  http://www.flickr.com/photos/rcasero/
> <itk_pstransform-bspline.png>



More information about the Insight-users mailing list