[BUG]: Coordinates transforms to native space using ANTs are off #388
No reviewers
Labels
No labels
CRITICAL
Stale
WIP
bug
concept
coordinate
dataset
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
maintenance
maps
marker
mask
on hold
parcellation
preprocess
question
ready
storage
template-space
triage
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
juaml/junifer!388
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/coords-ants"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is there an existing issue for this?
Current Behavior
When computing any marker on coordinates in native space, the coordinates in native space do not match the corresponding landmark in MNI space.
These are two examples in which the left (MNI space) do not match the right (T1w space).
In this first example, the coordinates are off-brain:
In this second example, the coordinates are in the brain, but not in the same landmark:
Expected Behavior
I expect that the coordinates point to the right landmark.
Steps To Reproduce
WorkdirManagercode so that temporary directories are not cleaned.sub-0001using"Power2011"using this script:Environment
Relevant log output
Anything else?
No response
This is due to two key differences between fsl and ANTs:
antsApplyTransformsToPointsexpects the inverse transform.Solutions:
antsApplyTransformsToPointsand do the same after reading the coordinates from the output file.Codecov Report
All modified and coverable lines are covered by tests ✅
Additional details and impacted files
100.00% <ø> (ø)Flags with carried forward coverage won't be shown. Click here to find out more.
50.00% <ø> (+3.33%)85.71% <ø> (ø)@fraimondo Can you please check if this solves your issue?
I can confirm that this code now provides the right transform for the two coordinates displayed in the issue.
@ -57,3 +57,3 @@pretransform_coordinates_path = (element_tempdir / "pretransform_coordinates.txt"element_tempdir / "pretransform_coordinates.csv")can we just do
x[0] *= -1... It's more easy to read than a lambda function to multiply two axis by -1 and another axis by 1.Same as above.
@ -57,3 +57,3 @@pretransform_coordinates_path = (element_tempdir / "pretransform_coordinates.txt"element_tempdir / "pretransform_coordinates.csv")Not sure I follow, could you please show what L63 should be?
@ -57,3 +57,3 @@pretransform_coordinates_path = (element_tempdir / "pretransform_coordinates.txt"element_tempdir / "pretransform_coordinates.csv")before L60