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

Resampling funcs to standard spaces fails in 1.4.0a0 #1626

Closed
markushs opened this issue May 9, 2019 · 12 comments · Fixed by #1627
Closed

Resampling funcs to standard spaces fails in 1.4.0a0 #1626

markushs opened this issue May 9, 2019 · 12 comments · Fixed by #1627
Labels
bug critical effort: medium Estimated medium effort task impact: high Estimated high impact task
Milestone

Comments

@markushs
Copy link
Contributor

markushs commented May 9, 2019

Hi,
You might be aware of this, but resampling of funcs to standard spaces produces strange results in in 1.4.0.a0. Here's an example (anat/sub-XX_space-MNI152Nlin2009cAsym_desc-preproc_T1w in red, overlaid on one func/*_space-MNI152NLin2009cAsym_boldref)

image

Here's just the func/*_space-MNI152NLin2009cAsym_boldref

image

I see this error in all subjects I've run through 1.4.0.a0 (to get around #1615 after implementing #1603), and for both MNI152NLin2009cAsym and MNI152NLin6Asym. Same data has been processed in previous versions of fmriprep without these issues.

I know that 1.4.0.a0 is a pre-release, so sorry if this an already known issue planned to be fixed for the "official" release.

@markushs
Copy link
Contributor Author

markushs commented May 9, 2019

Hi again,
I did some debugging, and it looks like antsApplyTransforms in /bold_std_trans_wf/_key_*/bold_to_std_transform gets t1_to_mniComposite-inputs (--transform) from both standard spaces.

Here's a screenshot from /bold_std_trans_wf/_key_MNI152NLin6Asym/bold_to_std_transform/command.txt (note the MNI152NLin2009cAsym-registration in addition to MNI152NLin6Asym)

image

Running antsApplyTransforms with the correct registration only seems to fix the problems I'm seeing.

Note that my original call to fmriprep didn't ask for MNI152NLin6Asym under output-spaces (I used --output-spaces T1w MNI152NLin2009cAsym to reproduce fmriprep-behavior from earlier versions). However, due to ICA-AROMA being run NLin6 was automatically added.

@effigies effigies added this to the 1.4.0 milestone May 9, 2019
@effigies effigies added bug critical effort: medium Estimated medium effort task impact: high Estimated high impact task labels May 9, 2019
@effigies
Copy link
Member

effigies commented May 9, 2019

@markushs Thanks so much for tracking this down! We're lucky to have you trying out the pre-release.

@oesteban
Copy link
Member

oesteban commented May 9, 2019

Okay, I can see this happening also on my settings. The KeySelect interface seems to work alright:

Node: single_subject_01_wf (func_preproc_task_mixedgamblestask_run_01_wf (bold_std_trans_wf (select_std (utility)
=================================================================================================================


 Hierarchy : fmriprep_wf.single_subject_01_wf.func_preproc_task_mixedgamblestask_run_01_wf.bold_std_trans_wf.select_std
 Exec ID : select_std.aI.a1


Original Inputs
---------------


* anat2std_xfm : ['/home/oesteban/tmp/fmriprep-ds005/work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin2009cAsym/registration/ants_t1_to_mniComp
osite.h5', '/home/oesteban/tmp/fmriprep-ds005/work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniComposite.h5']
* key : MNI152NLin6Asym
* keys : ['MNI152NLin2009cAsym', 'MNI152NLin6Asym']
* resolution : ['native', 2]

Execution Inputs
----------------


* anat2std_xfm : ['/home/oesteban/tmp/fmriprep-ds005/work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin2009cAsym/registration/ants_t1_to_mniComp
osite.h5', '/home/oesteban/tmp/fmriprep-ds005/work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniComposite.h5']
* key : MNI152NLin6Asym
* keys : ['MNI152NLin2009cAsym', 'MNI152NLin6Asym']
* resolution : ['native', 2]


Execution Outputs
-----------------


* anat2std_xfm : /home/oesteban/tmp/fmriprep-ds005/work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/anat_norm_wf/_template_MNI152NLin6Asym/registration/ants_t1_to_mniComposite.
h5
* key : MNI152NLin6Asym
* resolution : 2

So I guess I missed some connection to the ApplyTransforms node.

oesteban added a commit to oesteban/fmriprep that referenced this issue May 9, 2019
This PR fixes nipreps#1626.

The ``transforms`` input to ``MultyApplyTransforms`` had not been
updated to get fed by the ``KeySelect`` interface that demultiplexes
parameterized fields.

With great thanks to @markushs for his invaluable help catching this.
@oesteban
Copy link
Member

oesteban commented May 9, 2019

@markushs you are the goalkeeper of this release. Thank you so much.

@oesteban
Copy link
Member

oesteban commented May 9, 2019

@markushs pre-release 1.4.0a1 should post within the next couple of hours. Can I ask you to give it a try and confirm this problem has been addressed?

@markushs
Copy link
Contributor Author

@oesteban Yes, everything seems to work much better now! One observation though: the funcs in both MNI-spaces come out identical even though different--transform inputs are used. While NLin2009 and NLin6 are similar, they are not identical so I was a bit puzzled by this.

@oesteban
Copy link
Member

Are they identical bitwise or visually?

@oesteban
Copy link
Member

They should have different resolutions, for instance.

@markushs
Copy link
Contributor Author

So, the preprocessed funcs are both in native resolution (3.027 x 3.027 x 3 mm in both MNI spaces). The preprocessed BOLD time series are identical voxel-by-voxel to the 6th digit at least.

@markushs
Copy link
Contributor Author

image

@markushs
Copy link
Contributor Author

Sorry for not being of more help here, but I can at least confirm that the inputs to bold_std_trans_wf/outputnode are different across MNI output spaces. But they end up identical in derivatives/fmriprep/sub-XX/ses-XX/func (as you can see from the fslinfo output)

@oesteban
Copy link
Member

Thanks for the heads up, again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug critical effort: medium Estimated medium effort task impact: high Estimated high impact task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants