-
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
ENH: New estimation API (featuring a TOPUP implementation!) #115
Conversation
385bb3b
to
b819648
Compare
Hello @oesteban, Thank you for updating! Cheers! There are no style issues detected in this Pull Request. 🍻 To test for issues locally, Comment last updated at 2020-11-01 15:01:18 UTC |
b819648
to
3c81f8a
Compare
3c81f8a
to
618be5b
Compare
Brace yourselves, this is going in - I want to test #119 ASAP. |
Question - were you able to figure out how to get the topup warp as an itk tranfsform out of the fsl outputs? |
Regarding the warp, @smoia had it almost finished in nipy/nitransforms#51 - I will try to push this to the end line shortly. But in principle, warpings are not of much concern. The field coefficients are a different story. In order to make the output of all estimations consistent, all of them should have the same outputs of TOPUP, which means a fieldmap (I'm going to avoid calling it a warp, because that means you know the readout time of the target image) and the coefficients of a tensor B-Spline field supporting such field (#119). I know this second part is going to be tricky because TOPUP dumps out a NIfTI where header information has not been adapted to the target image. So after finishing #119, I'll also have to write something that adapts FSL coefficients to a NIfTI with headers consistent with the original (interpolated) field. This shouldn't be super hard though. With those two pieces, I think the new API will be pretty solid:
|
2.0.0rc4 * FIX: Convert SEI fieldmaps given in rad/s into Hz (#127) * FIX: Limit ``3dQwarp`` to maximum 4 CPUs for stability reasons (#128) * ENH: Generate a simple mask after correction (#161) * ENH: Increase unit-tests coverage of ``sdcflows.fieldmaps`` (#159) * ENH: Optimize tensor-product B-Spline kernel evaluation (#157) * ENH: Add a memory check to dynamically limit interpolation blocksize (#156) * ENH: Massage TOPUP's fieldcoeff files to be compatible with ours (#154) * ENH: Add a simplistic EPI masking algorithm (#152) * ENH: Utility that returns the ``B0FieldSource`` of a given potential EPI target (#151) * ENH: Write ``fmapid-`` entity in Derivatives (#150) * ENH: Multiplex fieldmap estimation outputs into a single ``outputnode`` (#149) * ENH: Putting the new API together on a base workflow (#143) * ENH: Autogenerate ``B0FieldIdentifiers`` from ``IntendedFor`` (#142) * ENH: Finalizing the API overhaul (#132) * ENH: Keep a registry of already-used identifiers (and auto-generate new) (#130) * ENH: New objects for better representation of fieldmap estimation (#114) * ENH: Show FieldmapReportlet oriented aligned with cardinal axes (#120) * ENH: New estimation API (featuring a TOPUP implementation!) (#115) * DOC: Minor improvements to the literate workflows descriptions. (#162) * DOC: Fix typo in docstring (#155) * DOC: Enable NiPype's sphinx-extension to better render Interfaces (#131) * MAINT: Drop Python 3.6 (#160) * MAINT: Enable Git-archive protocol with setuptools-scm-archive (#153) * MAINT: Migrate TravisCI -> GH Actions (completion) (#138) * MAINT: Migrate TravisCI -> GH Actions (#137) * MAINT: Minimal unit test and refactor of pepolar workflow node (#133) * MAINT: Collect code coverage from tests on Circle (#122) * MAINT: Test minimum dependencies with TravisCI (#96) * MAINT: Add FLIRT config files to prepare for TOPUP integration (#116)
Summary
Builds a new API that is uniform across implemented estimation methods:
3dQwarp
, and adding FSL TOPUPCHANGES
sdcflows.interfaces.epi
- There was a conceptual misunderstanding about the echo spacing / readout time. These inter-related timing parameters are relevant for all EPI datasets that are targetted for correction, as well as in PEPOLAR inputs because it scales the amount of distortion at each voxel. We had these interfaces within the fieldmap module (sdcflows.interfaces.fmap
), which is not correct. You need the parameter fundamentally for unwarping, and it so happens that it is necessary when fieldmapping with PEPOLAR. A new module seems cleaner methodologically.FieldmapReportlet
interface to allow displacement fields (i.e., 4D NIfTIs) to be plotted, just for the convenience of not having to extract the nonzero dimension.sdcflows.interfaces.utils.Flatten
interface that unravels lists of 3D and 4D EPIs into a list of 3D EPIs with corresponding metadata expanded too. This is useful for PEPOLAR corrections and replaces hacky parts of the old preparation workflow. Potentially upstreamable to niworkflowssdcflows.models
submodule. This new module contains the estimation methods. The vision is to have a scikit-learn-like approach with some sort offit()
andpredict()
organization.sdcflows.models
implements thefit()
part of it. Inside we find:sdcflows.models.fieldmap
: contains both direct B0 maps AND phase-difference maps. This was almost the case already, but some minimal changes have contributed to a more streamlined workflow. Phase-difference maps are massaged (phase-unwrapped, denoised, masked, converted to rad/s) and then passed in into the general direct B0 workflow. If the input is a direct B0, the phase-difference preprocessing is just skipped over. Both strategies share the exact same magnitude components processing.sdcflows.models.pepolar
: simplifies the existing workflow for3dQwarp
assuming the inputs are more massaged, in order to allow the FSL TOPUP implementation to have both the same interface.sdcflows.models.syn
: just transferred from the originalsdcflows.workflows.syn
sdcflows.workflows.base
: updated to work with the newmodels
submodule, and eliminated the many heuristics and validation checks that will now be done with the new features in ENH: New objects for better representation of fieldmap estimation #114.TODO (on a separate PR)
3dQwarp
(similarly to Improve/finish Phasediff SDC regularization with B-Splines #14).