Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX,MNT import surfaces generated from volumes with any voxel size #531

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

mvdoc
Copy link
Contributor

@mvdoc mvdoc commented Apr 5, 2024

This PR fixes the bug first described in #300. Pycortex always assumed that the surfaces were generated out of T1s with 1mm3 isotropic voxel size. If one imported surfaces generated from other volumes (e.g., sub-mm), then the surfaces would be misaligned (see example in #300). To fix this issue, here I'm simply importing and converting the surfaces to gifti with Freesurfer's mris_convert --to-scanner, which uses the same coordinate system as the T1 rather than the TKR system used for surfaces.

This change produces the same surfaces as the old code for 1mm3 volumes. I'm waiting for freesurfer to finish on a sub-mm volume to test it there too.

(This PR also cleans up the code in that function a bit to make it easier to maintain...)

@mvdoc mvdoc changed the title FIX,MNT aimport surfaces generated from volumes with any voxel size FIX,MNT import surfaces generated from volumes with any voxel size Apr 5, 2024
@mvdoc
Copy link
Contributor Author

mvdoc commented Apr 5, 2024

OK, I tested this with a sub-mm T1, and it worked as well.

@mvdoc mvdoc merged commit 35ebd43 into gallantlab:main Apr 8, 2024
@mvdoc mvdoc deleted the fix/import_subj branch April 8, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant