Skip to content

Commit a05e701

Browse files
committed
feat(TOPUP): an initial implementation of SD estimation.
Adds a new subworkflow based on FSL TOPUP to integrate SD estimation for the ds001771 dataset. - [x] Pin niworkflows to current master (while I release 1.2.0rc5 containing nipreps/niworkflows#503, nipreps/niworkflows#504, which are used here). - [x] Create a new sdc estimation workflow, with the expectation of upstreaming it to SDCFlows. - [x] Implement the barebones of how nipreps/sdcflows#101 could look like. Also to be upstreamed to SDCFlows when mature. - [x] Stick TOPUP from FSL 6.0.3 in the Docker image, since topup from FSL 5.0.x is really unstable (for instance, it fails with a segmentation fault on the workflow of ds001771) Resolves: #92
1 parent 6792e96 commit a05e701

File tree

13 files changed

+265
-0
lines changed

13 files changed

+265
-0
lines changed

.docker/fsl-6.0/bin/topup

36.4 MB
Binary file not shown.

.docker/fsl-6.0/lib/libgfortran.so.3

1.13 MB
Binary file not shown.

.docker/fsl-6.0/lib/libopenblas.so.0

35 MB
Binary file not shown.

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ ENV FSLDIR="/usr/share/fsl/5.0" \
9292
AFNI_PLUGINPATH="/usr/lib/afni/plugins"
9393
ENV PATH="/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH"
9494

95+
COPY .docker/fsl-6.0/bin/topup /usr/share/fsl/5.0/bin/topup
96+
COPY .docker/fsl-6.0/lib/* /usr/lib/fsl/5.0/
97+
9598
# Installing ANTs 2.2.0 (NeuroDocker build)
9699
ENV ANTSPATH=/usr/lib/ants
97100
RUN mkdir -p $ANTSPATH && \

dmriprep/config/reports-spec.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ sections:
2626
caption: Surfaces (white and pial) reconstructed with FreeSurfer (<code>recon-all</code>)
2727
overlaid on the participant's T1w template.
2828
subtitle: Surface reconstruction
29+
- name: Fieldmaps
30+
ordering: session,run
31+
reportlets:
32+
- bids: {datatype: figures, desc: pepolar, suffix: fieldmap}
33+
caption: Inhomogeneities of the *B0* field introduce (oftentimes severe) spatial distortions
34+
along the phase-encoding direction of the image. Utilizing two or more images with different
35+
phase-encoding polarities (PEPolar) or directions, it is possible to estimate the inhomogeneity
36+
of the field. The plot below shows a reference EPI (echo-planar imaging) volume generated
37+
using two or more EPI images with varying phase-encoding blips.
38+
description: Hover on the panels with the mouse pointer to also visualize the intensity of the
39+
inhomogeneity of the field in Hertz.
40+
static: false
41+
subtitle: "Susceptibility-derived Distortion Correction (SDC): field inhomogeneity estimation"
2942
- name: Diffusion
3043
ordering: session,acquisition,run
3144
reportlets:

dmriprep/data/flirtsch/b02b0.cnf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Resolution (knot-spacing) of warps in mm
2+
--warpres=20,16,14,12,10,6,4,4,4
3+
# Subsampling level (a value of 2 indicates that a 2x2x2 neighbourhood is collapsed to 1 voxel)
4+
--subsamp=2,2,2,2,2,1,1,1,1
5+
# FWHM of gaussian smoothing
6+
--fwhm=8,6,4,3,3,2,1,0,0
7+
# Maximum number of iterations
8+
--miter=5,5,5,5,5,10,10,20,20
9+
# Relative weight of regularisation
10+
--lambda=0.005,0.001,0.0001,0.000015,0.000005,0.0000005,0.00000005,0.0000000005,0.00000000001
11+
# If set to 1 lambda is multiplied by the current average squared difference
12+
--ssqlambda=1
13+
# Regularisation model
14+
--regmod=bending_energy
15+
# If set to 1 movements are estimated along with the field
16+
--estmov=1,1,1,1,1,0,0,0,0
17+
# 0=Levenberg-Marquardt, 1=Scaled Conjugate Gradient
18+
--minmet=0,0,0,0,0,1,1,1,1
19+
# Quadratic or cubic splines
20+
--splineorder=3
21+
# Precision for calculation and storage of Hessian
22+
--numprec=double
23+
# Linear or spline interpolation
24+
--interp=spline
25+
# If set to 1 the images are individually scaled to a common mean intensity
26+
--scale=1

dmriprep/data/flirtsch/b02b0_1.cnf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Resolution (knot-spacing) of warps in mm
2+
--warpres=20,16,14,12,10,6,4,4,4
3+
# Subsampling level (a value of 2 indicates that a 2x2x2 neighbourhood is collapsed to 1 voxel)
4+
--subsamp=1,1,1,1,1,1,1,1,1
5+
# FWHM of gaussian smoothing
6+
--fwhm=8,6,4,3,3,2,1,0,0
7+
# Maximum number of iterations
8+
--miter=5,5,5,5,5,10,10,20,20
9+
# Relative weight of regularisation
10+
--lambda=0.0005,0.0001,0.00001,0.0000015,0.0000005,0.0000005,0.00000005,0.0000000005,0.00000000001
11+
# If set to 1 lambda is multiplied by the current average squared difference
12+
--ssqlambda=1
13+
# Regularisation model
14+
--regmod=bending_energy
15+
# If set to 1 movements are estimated along with the field
16+
--estmov=1,1,1,1,1,0,0,0,0
17+
# 0=Levenberg-Marquardt, 1=Scaled Conjugate Gradient
18+
--minmet=0,0,0,0,0,1,1,1,1
19+
# Quadratic or cubic splines
20+
--splineorder=3
21+
# Precision for calculation and storage of Hessian
22+
--numprec=double
23+
# Linear or spline interpolation
24+
--interp=spline
25+
# If set to 1 the images are individually scaled to a common mean intensity
26+
--scale=1

dmriprep/data/flirtsch/b02b0_2.cnf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Resolution (knot-spacing) of warps in mm
2+
--warpres=20,16,14,12,10,6,4,4,4
3+
# Subsampling level (a value of 2 indicates that a 2x2x2 neighbourhood is collapsed to 1 voxel)
4+
--subsamp=2,2,2,2,2,1,1,1,1
5+
# FWHM of gaussian smoothing
6+
--fwhm=8,6,4,3,3,2,1,0,0
7+
# Maximum number of iterations
8+
--miter=5,5,5,5,5,10,10,20,20
9+
# Relative weight of regularisation
10+
--lambda=0.005,0.001,0.0001,0.000015,0.000005,0.0000005,0.00000005,0.0000000005,0.00000000001
11+
# If set to 1 lambda is multiplied by the current average squared difference
12+
--ssqlambda=1
13+
# Regularisation model
14+
--regmod=bending_energy
15+
# If set to 1 movements are estimated along with the field
16+
--estmov=1,1,1,1,1,0,0,0,0
17+
# 0=Levenberg-Marquardt, 1=Scaled Conjugate Gradient
18+
--minmet=0,0,0,0,0,1,1,1,1
19+
# Quadratic or cubic splines
20+
--splineorder=3
21+
# Precision for calculation and storage of Hessian
22+
--numprec=double
23+
# Linear or spline interpolation
24+
--interp=spline
25+
# If set to 1 the images are individually scaled to a common mean intensity
26+
--scale=1

dmriprep/data/flirtsch/b02b0_4.cnf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Resolution (knot-spacing) of warps in mm
2+
--warpres=20,16,14,12,10,6,4,4,4
3+
# Subsampling level (a value of 2 indicates that a 2x2x2 neighbourhood is collapsed to 1 voxel)
4+
--subsamp=4,4,2,2,2,1,1,1,1
5+
# FWHM of gaussian smoothing
6+
--fwhm=8,6,4,3,3,2,1,0,0
7+
# Maximum number of iterations
8+
--miter=5,5,5,5,5,10,10,20,20
9+
# Relative weight of regularisation
10+
--lambda=0.035,0.006,0.0001,0.000015,0.000005,0.0000005,0.00000005,0.0000000005,0.00000000001
11+
# If set to 1 lambda is multiplied by the current average squared difference
12+
--ssqlambda=1
13+
# Regularisation model
14+
--regmod=bending_energy
15+
# If set to 1 movements are estimated along with the field
16+
--estmov=1,1,1,1,1,0,0,0,0
17+
# 0=Levenberg-Marquardt, 1=Scaled Conjugate Gradient
18+
--minmet=0,0,0,0,0,1,1,1,1
19+
# Quadratic or cubic splines
20+
--splineorder=3
21+
# Precision for calculation and storage of Hessian
22+
--numprec=double
23+
# Linear or spline interpolation
24+
--interp=spline
25+
# If set to 1 the images are individually scaled to a common mean intensity
26+
--scale=1

dmriprep/workflows/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from ..interfaces.reports import SubjectSummary, AboutSummary
2020
from ..utils.bids import collect_data
2121
from .dwi.base import init_early_b0ref_wf
22+
from .fmap.base import init_fmap_estimation_wf
2223

2324

2425
def init_dmriprep_wf():
@@ -292,6 +293,12 @@ def init_single_subject_wf(subject_id):
292293
]),
293294
])
294295

296+
fmap_estimation_wf = init_fmap_estimation_wf(subject_data["dwi"])
297+
workflow.connect([
298+
(referencenode, fmap_estimation_wf, [
299+
("dwi_reference", "inputnode.dwi_reference"),
300+
("dwi_mask", "inputnode.dwi_mask")]),
301+
])
295302
return workflow
296303

297304

0 commit comments

Comments
 (0)