Linear transforms to displacement field


I would like to create a deformation field from 2 linear transforms, which are defined on different regions of my image.

So, I have two different linear transforms (one for the right hemisphere, and one for the left hemisphere of the brain). I also have 2 masks, corresponding to the two hemispheres. And I would like to create a deformation field where I get the left linear transform applied over the left hemisphere mask, and the right linear transform applied over the right mask.
I get that this should lead to some discontinuities at the jonction, but I don’t think that this should be a problem for my further calculation.

I am just starting with ITK, so any help will probably be a lot to me,

Thanks in advance !! :hugs:

You could iterate through your desired deformation field image, and for each pixel check whether it belongs to one of the masks, and if so calculate displacement for it using TransformContinuousIndexToPhysicalPoint and TransformPhysicalPointToIndex from image and TransformPoint from the corresponding linear transform. Pay attention to the direction of transform (moving to registered). Good luck!

1 Like