-
Notifications
You must be signed in to change notification settings - Fork 26
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
SDC-pepolar: topup implementation v2 #106
Conversation
Best reviewed: commit by commit
Optimal code review plan
|
Hi @oesteban. Is there still any interest in this approach? I'm asking as it was mentioned in a SDC-issue over at fmriprep. I had the impression that you were working on an alternative, and likely improved, implementation under dmriprep. If that's the case, should I just close the draft? |
Hi @markushs, thanks for bringing this up. The situation, indeed, is a bit messy. We do have a functional alternative working for dMRIPrep -> https://github.com/nipreps/dmriprep/blob/a2cd0decb21e18697bec56942ec9c6dbda7e7e1b/dmriprep/workflows/fmap/base.py While developing that, I realized of a few issues that are holding me back in upstreaming that code on to SDCFlows (and hence, make it available to fMRIPrep):
I think both issues (BIDS specs and FSL 6) are the two main blockers for this. Both have workarounds, but I honestly think they are not transparent nor worth our time. But happy to be convinced on the contrary or learning of a more creative approach. |
We've made some progress in uniformizing the estimation API, and now we even have a base implementation for TOPUP: sdcflows/sdcflows/models/pepolar.py Lines 25 to 120 in 797eccb
I'm sure there are many edge cases we will need to account for, but the foundation is there. We even have a test running TOPUP: https://697-189292208-gh.circle-artifacts.com/0/tmp/tests/sdcflows/sub-HCP101006/figures/sub-HCP101006_desc-pepolar_fieldmap.svg The idea is that all estimation strategies (namely, B0 fieldmaps acquired with Spiral Echo Imaging, phase-difference fieldmaps --both 2-echos and phasediff--, pepolar-AFNI, pepolar-TOPUP, end fieldmapless-SyN) produce not just a processed version of the fieldmap, also a field of B-Splines coefficients (i.e., the fieldcoeff output of TOPUP) -- please follow progress on this at #119. This goes along with a more clear separation of estimation and correction. Estimation will generate the field and coefficients. These can be moved to the target image to be corrected, the field interpolated from the coefficients in the new space and finally, scaled by the Readout Time to generate the actual displacements field. |
Hi @markushs I think we should redirect these efforts towards the implementation we have on the In regards this particular PR, can I close it? |
Hi @oesteban |
You have already contributed with much - the fact that your two PRs on this TOPUP implementation haven't made it to master doesn't mean they don't have contributed to SDCFlows overall. Your initiative has stimulated the software go forward and has given ideas to others about how to proceed to make progress. Looking into the future, although you might not speak Python fluently today I'm sure your feedback will be very valuable on others' PRs. And that's only the start. Please let me know if you want to be included - as I said, we'd be honored :). Closing this for the time being. |
Ref #37
Decided to do this as a new PR as the initial comments to #76 required implementing the approach somewhat differently.
pepolar.py
is now modified to run fsl topup.pepolar.py
returns a topup estimated fieldmap (in Hz) and a "magnitude" image (the unwarped epis from topup).Next, the topup estimated fieldmap is converted to a displacement field using routines from the
sdcflows.workflows.fmap
module (fmap_wf
+fmap2field_wf
).Finally, unwarping is performed using the
sdcflow_workflows.unwarp
module.