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

[RTM] ENH: Use mri_robust_template for T1 merge #481

Merged
merged 5 commits into from Apr 26, 2017

Conversation

effigies
Copy link
Member

We've found that FLIRT alignment can sometimes fail on T1 images. Although a 9-DOF affine registration resolves the issue, it appears to be an artifact problem, rather than a scaling issue that would require the extra 3 degrees of freedom.

This PR uses FreeSurfer's mri_robust_template to generate a structural reference image.

mri_robust_template throws an error on single volumes, so I subclass freesurfer.RobustTemplate to copy the input file in that case. (I use a hack similar to that in freesurfer.ReconAll to fiddle with the cmdline.)

Closes: #439, #473

@effigies
Copy link
Member Author

This is running fine for me. Do we still want to pass the pre-merged T1 to FreeSurfer? On the one hand there's no scaling issue to correct before passing it in; on the other, it's what FS will do immediately, anyway, so no need to duplicate work.

Leaving it as is also puts the original T1s into the FreeSurfer directory, which is either good (for provenance sake) or bad (for taking up space), depending on your priority.

I can go either way.

@chrisgorgo
Copy link
Contributor

I would lean towards feeding one merged image.

@chrisgorgo
Copy link
Contributor

BTW - can we get a changelog entry? It would be good that now the templates are unbiased. This also closes #310

@effigies
Copy link
Member Author

When you say unbiased, you mean that we're no longer aligning to the first image before taking the average? Because we're still doing that. The FreeSurfer invocation is --inittp 1 --fixtp, which means "use first frame as the 'init' time point and align to that time point", so I kept on with this.

I can play with dropping those to see what effect that has, but I think maybe that makes sense as a separate PR. This fixes #439 in the short term while keeping as close as possible to existing behavior.

@chrisgorgo
Copy link
Contributor

Ok then this does not close #310. Lets leave it to another PR.

@effigies
Copy link
Member Author

The new merge stripped original filename info from the pipeline. This should resolve that, though another option would be to pull the bids_info node out of surface_recon_wf and just pass in the subject_id. But I figured there might be something else that counts on this name getting propagated through properly, so I went with this option.

@effigies effigies changed the title ENH: Use mri_robust_template for T1 merge [RTM] ENH: Use mri_robust_template for T1 merge Apr 26, 2017
@effigies
Copy link
Member Author

Re-ran s497 from scratch overnight. Outputs LGTM. Moving to interfaces.freesurfer to be consistent with #484. Will merge on pass.

@effigies effigies merged commit 50b534a into nipreps:master Apr 26, 2017
@effigies effigies deleted the enh/robust_template branch April 26, 2017 15:45
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.

T1 merge is failing on s497
2 participants