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

ENH: Massage TOPUP's fieldcoeff files to be compatible with ours #154

Merged
merged 3 commits into from
Dec 14, 2020

Conversation

oesteban
Copy link
Member

@oesteban oesteban commented Dec 13, 2020

TOPUP-generated "fieldcoeff" files are just B-Spline fields, where the shape
of the field is fixated to be a decimated grid of the original image by a
factor of 2x and added 3 pixels on each dimension.
This is one root reason why TOPUP errors (FSL 6) or segfaults (FSL5), when the
input image has odd number of voxels along one or more directions.

These "fieldcoeff" are fixated to be zero-centered, and have "plumb" orientation
(as in, aligned with cardinal/imaging axes).
Voxel sizes are always 2.0 (dimensionless).

This interface modifies these coefficient files to be fully-fledged NIfTI images
aligned with the reference image.
Therefore, the s-form header of the coefficients file is updated to match that
of the reference file.
The s-form header is used because the imaging axes may be oblique.

The q-form retains the original header and is marked with code 0.

@oesteban oesteban force-pushed the enh/topup-coeff-conformation branch from 5ac7b50 to 97e5df7 Compare December 13, 2020 14:50
TOUP-generated "fieldcoeff" files are just B-Spline fields, where the shape
of the field is fixated to be a decimated grid of the original image by a
factor of 2x and added 3 pixels on each dimension.
This is one root reason why TOPUP errors (FSL 6) or segfaults (FSL5), when the
input image has odd number of voxels along one or more directions.

These "fieldcoeff" are fixated to be zero-centered, and have "plumb" orientation
(as in, aligned with cardinal/imaging axes).
The q-form of these NIfTI files is always diagonal, with the decimation factors
set on the diagonal (and hence, the voxel zooms).
The origin of the q-form is set to the reference image's shape.

This interface modifies these coefficient files to be fully-fledged NIfTI images
aligned with the reference image.
Therefore, the s-form header of the coefficients file is updated to match that
of the reference file.
The s-form header is used because the imaging axes may be oblique.

The q-form retains the original header and is marked with code 0.
@oesteban oesteban force-pushed the enh/topup-coeff-conformation branch from 97e5df7 to 6ed47ae Compare December 13, 2020 23:43
@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #154 (6088fe3) into master (3361f8a) will decrease coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #154      +/-   ##
==========================================
- Coverage   94.62%   94.44%   -0.18%     
==========================================
  Files          19       19              
  Lines        1135     1171      +36     
  Branches      150      153       +3     
==========================================
+ Hits         1074     1106      +32     
- Misses         34       37       +3     
- Partials       27       28       +1     
Flag Coverage Δ
travis 81.02% <100.00%> (+0.60%) ⬆️
unittests 94.25% <100.00%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdcflows/interfaces/bspline.py 97.22% <100.00%> (+0.51%) ⬆️
sdcflows/workflows/fit/pepolar.py 100.00% <100.00%> (ø)
sdcflows/interfaces/epi.py 88.88% <0.00%> (-11.12%) ⬇️
sdcflows/utils/epimanip.py 96.29% <0.00%> (-1.86%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3361f8a...6088fe3. Read the comment docs.

@oesteban oesteban merged commit 7f72285 into nipreps:master Dec 14, 2020
@oesteban oesteban deleted the enh/topup-coeff-conformation branch December 14, 2020 10:59
oesteban added a commit that referenced this pull request Dec 24, 2020
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)
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.

1 participant