Skip to content

[RTM] ENH: Register FreeSurfer template to FMRIPREP template #733

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

Merged
merged 7 commits into from
Oct 8, 2017

Conversation

effigies
Copy link
Member

@effigies effigies commented Oct 2, 2017

Addresses issue raised in #726 (comment).

Given this, I think we should output the registration transform, to give users the tools to move between FMRIPREP and FreeSurfer spaces. I'd recommend the LTA format, since that has more metadata about the source and target spaces; if users need to convert to other formats, they will presumably have access to the LTAConvert tool.

To do:

  • Ensure output surfaces are aligned with T1_preproc
  • Affine

@effigies effigies force-pushed the fix/freesurfer_register branch 2 times, most recently from 70510d2 to b7376f0 Compare October 4, 2017 23:29
@effigies
Copy link
Member Author

effigies commented Oct 5, 2017

Addressing this approach to BEP 014, I believe what we'll want is:

fmriprep/sub-<label>/anat/sub-<label>_T1w_preproc_target-fsnative_affine.txt

In which case, we want the inverse of what I'm currently generating, which is easily constructed with

lta_convert --inlta transform.lta --outitk transform.txt --invert

I think the most appropriate alternative would be to add a transform to the freesurfer/sub-<label>/mri/transforms/ directory, and I feel we should make minimal changes there.

@effigies effigies force-pushed the fix/freesurfer_register branch 2 times, most recently from f4a03f3 to db69910 Compare October 5, 2017 18:37
@effigies effigies force-pushed the fix/freesurfer_register branch 4 times, most recently from a57b762 to 155812c Compare October 6, 2017 14:38
@effigies effigies force-pushed the fix/freesurfer_register branch 3 times, most recently from 5476457 to 4f22e86 Compare October 6, 2017 18:49
@effigies effigies changed the title [WIP] ENH: Register FreeSurfer template to FMRIPREP template [RTM] ENH: Register FreeSurfer template to FMRIPREP template Oct 6, 2017
@effigies
Copy link
Member Author

effigies commented Oct 6, 2017

To review this PR, separately review #741, and then look at effigies/fmriprep@fsfix_common...fix/freesurfer_register.

@effigies effigies force-pushed the fix/freesurfer_register branch 2 times, most recently from 2c74d20 to 0a3adce Compare October 6, 2017 20:14
Copy link
Member

@oesteban oesteban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems reasonable, with the constraints of my limited knowledge about surfaces in freesurfer.

@@ -24,6 +24,7 @@ ds005/out/fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_class-WM_pro
ds005/out/fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_dtissue.nii.gz
ds005/out/fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_preproc.nii.gz
ds005/out/fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_warp.h5
ds005/out/fmriprep/sub-01/anat/sub-01_T1w_target-fsnative_affine.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the filename was sub-01_T1w_preproc_target-fsnative_affine.txt (missing _preproc)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did change it to make it more like ds005/out/fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_warp.h5, which is a transform from T1w space to MNI152NLin2009cAsym. Speaking of which, @chrisfilo, reading the BEP, should that be a target-MNI... instead of space-MNI...?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

@@ -218,3 +224,20 @@ def normalize_surfs(in_file):
pointset.meta.data.insert(2, geom_type)
img.to_filename(fname)
return os.path.abspath(fname)


def load_transform(fname):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a minimal docstring here?

@effigies effigies force-pushed the fix/freesurfer_register branch 3 times, most recently from 47fa78a to 0b153ec Compare October 7, 2017 13:42
@effigies effigies force-pushed the fix/freesurfer_register branch from 0b153ec to 9ed6a6e Compare October 7, 2017 17:07
@oesteban oesteban merged commit 2a2ac71 into nipreps:master Oct 8, 2017
@effigies effigies deleted the fix/freesurfer_register branch October 8, 2017 16:32
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.

3 participants