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

Ramón Casero Cañas rcasero at gmail.com
Thu Jul 7 20:18:00 EDT 2011


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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itk_pstransform-bspline.png
Type: image/png
Size: 5885 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110708/95c31a0b/attachment.png>


More information about the Insight-users mailing list