Conversation
|
Related to #1881 I've tested this vs DT orientation - if I pull V1 before applying the warp, I can get similar results to the tensor after PPD. Need to test on template building. The idea is if the mean affine is not close to zero, reorienting the warps will produce better shape updates. |
|
I tested the displacement field reorientation by doing a nonlinear registration, then rotating the fixed image, and applying the same rotation to the warp field. I can then recover the registration solution, indicating that the warp field is being reoriented correctly. It's harder to judge a template performance difference because the average rotation converges quite quickly to zero, but it seems like the right thing to do. |
|
Changed -e displacement field to -e physical-vector, as it's generic to any vector in ITK physical coordinates. Also updated docs to clarify this |
Reorient vectors like we do for tensors.
This composes the local jacobians from the composite transform into one, then does a polar decomposition to get a rotation. Thus it should preserve vector magnitude.
It's up to the user to ensure that the vectors are sensibly interpolated. For axial data, it probably makes sense to use nearest neighbor interpolation. At the least, data should be projected into one hemisphere so that we don't interpolate x and -x.
I've also added an extra option for displacement vector data in
antsApplyTransforms. Displacement fields from ITK / ANTs registration are based in physical space. Generic vectors (-e 1) are assumed to be in index space, and are rebased accordingly.For displacement fields, the vectors are signed and should have some spatial regularity, so linear interpolation might work better.