ENH: Vector reorientation #1895
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.