[Insight-users] how to calculate displacement from B-Spline parameters

M.Staring at lumc.nl M.Staring at lumc.nl
Wed Oct 29 11:02:12 EDT 2008


Hi Pinpress,

when you do the affine + B-spline registration you have to set the
affine result in the bulk transform of the B-spline. You have to do this
also when you compute the displacement field. If you forget to do that
than you will only compute the displacement of the B-spline part. I can
imagine that this part is almost zero, since the match between the
larger and smaller circle can be captured by an affine transformation
only. 

Can you check that you did set the affine transform in the bulktransform
of the B-spline?

I find it hard to judge the images you uploaded. Can you easily
construct images where the deformation field is evaluated a coarser
grid, with larger arrows?

The error seems to be a bug in your code somewhere. If you post your
code we may be able to track it down.

Marius


> -----Original Message-----
> From: insight-users-bounces at itk.org 
> [mailto:insight-users-bounces at itk.org] On Behalf Of pinpress
> Sent: Wednesday, October 29, 2008 3:30 PM
> To: insight-users at itk.org
> Subject: Re: [Insight-users] how to calculate displacement 
> from B-Spline parameters
> 
> 
> Thanks, Marius.
> 
> I believe that the example code DeformableRegistration15.cxx 
> did exactly
> what you have suggested. Basically, it transforms a fixed 
> point to get the
> location of the corresponding moving point, and explicitly 
> calculate the
> displacement vector. This is also what I did. However, the 
> displacement
> field just does not make sense to me at all.
> 
> Please let me illustrate by proving a test case. I have 
> uploaded the fixed
> image, moving image (by dilating the fixed image), and applied the BS
> registration as well as the LevelSet registration (example code from
> DeformableRegistration5.cxx). The output images from the BS and LS
> registrations are overlaid with the displacement vectors 
> generated from the
> explicit deformation field. (BS registration was performed with either
> Affine registration as a preprocessing, or BS only by setting 
> the proper #
> of iterations.) As you can see, both BS and LS registrations 
> gave comparable
> output image, both similar to the fixed image. However, the 
> displacement
> vectors generated from LS makes a lot sense, whereas those from BS
> registration do not make sense at all. 
> 
> What's interesting also is that the displacement vectors from BS
> registration seem also dependent on whether affine 
> registration is performed
> or not. But shouldn't the bulk transform that takes care of the global
> motion also be included in the overall transformation when 
> transforming a
> fixed point into its moving space?
> 
> I appreciate if anyone could enlighten me what is going on 
> here. I have
> spent a lot of time but just wasn't able to figure out why or 
> what is wrong.
> thanks a million!
> 
> (BTW, it's the first time uploading a file. I hope they work.)
> 
> http://www.nabble.com/file/p20228316/fixed.png fixed.png 
> http://www.nabble.com/file/p20228316/moving.png moving.png 
> http://www.nabble.com/file/p20228316/output_Affine_and_BS.png
> output_Affine_and_BS.png 
> http://www.nabble.com/file/p20228316/output_BSOnly.png 
> output_BSOnly.png 
> http://www.nabble.com/file/p20228316/output_LS.png output_LS.png 
> 
> 
> 
> Hi Pinpress,
> 
> you can compute the displacement of a point x by calling the
> TransformPoint() function from the B-spline transform:
> 
> PointType x, y, displacement;
> // you fill it with whatever point you are interested in
> y = bSplineTransform->TransformPoint( x );
> displacement = y - x;
> 
> In case you want to compute these things afterwards, you will have to
> store all information that defines a 
> BSplineDeformableTransform. That is
> not only the parameters, but also information about the grid:
> GridRegion, GridSpacing, GridOrigin, GridDirection. And of course the
> BulkTransform, the dimension of your data, and the spline order. Then
> the simplest thing to do is create a new 
> BSplineDeformableTransform and
> feed all this data to it, then call the TransformPoint() again.
> 
> Hope this helps,
> 
> Marius Staring
> -- 
> View this message in context: 
> http://www.nabble.com/how-to-calculate-displacement-from-B-Spl
ine-parameters-tp20220125p20228316.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.175 / Virus Database: 270.8.4/1754 - Release 
> Date: 10/29/2008 7:45 AM
> 


More information about the Insight-users mailing list