Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f5e54c4
Control anatomical N4 and mask the anatomical template merge
mattcieslak Aug 2, 2026
90ec410
Support Rigid/Affine intramodal templates and honour the CLI options
mattcieslak Aug 3, 2026
f461e14
Write out the T2w derivatives instead of discarding them
mattcieslak Aug 3, 2026
46fc453
Write the intramodal b=0 template into the anat directory
mattcieslak Aug 3, 2026
a005aa6
Allow dwiref in the anat directory so the sink can write
mattcieslak Aug 3, 2026
5ee7694
Resample the intramodal template into ACPC before writing it
mattcieslak Aug 3, 2026
865bf46
Export the intramodal transforms so the space is reachable
mattcieslak Aug 3, 2026
7fe2855
Make the ACPC-template sink test robust to node insertions
mattcieslak Aug 3, 2026
82d0a0c
Make the intramodal registration reportlet show the registration
mattcieslak Aug 3, 2026
9285cf9
Skip the intramodal template for single-group subjects instead of fai…
mattcieslak Aug 3, 2026
21f5cc7
Add per-input template QC metrics and an agreement map
mattcieslak Aug 3, 2026
fb6a10c
Bound DIFFPREP's threads so nipype's scheduling is honest
mattcieslak Aug 3, 2026
d511dab
Correct the DIFFPREP thread-declaration rationale to match measurement
mattcieslak Aug 3, 2026
74a2fd6
Make SynthSeg and SynthStrip visible to nipype's GPU scheduler
mattcieslak Aug 3, 2026
b19aced
Pass --ncores to TORTOISEProcess so its CPU budget is real
mattcieslak Aug 4, 2026
51764dd
Add per-session TSNR over the b=0 volumes
mattcieslak Aug 4, 2026
8cb7937
Check the TSNR wiring on the built graph, not the source text
mattcieslak Aug 4, 2026
5dfb1c8
Stop N4's log-domain fit being steered by near-zero voxels
mattcieslak Aug 4, 2026
b9da54a
Give unbiased template creation its own registration settings
mattcieslak Aug 4, 2026
7cb2074
Keep the anatomical intensity truncation out of the data
mattcieslak Aug 4, 2026
5d9bc62
Expose TORTOISE's GPU/CPU volume split as --tortoise-gpu-cpu-ratio
mattcieslak Aug 6, 2026
046390f
Declare TORTOISEConvert's memory so nipype can bound it
mattcieslak Aug 7, 2026
3cccd2a
Derive TORTOISEConvert's memory from the series instead of guessing
mattcieslak Aug 7, 2026
477ae4b
Remove interface outputs accidentally committed to the repo root
mattcieslak Aug 7, 2026
62cb9ea
remove accidentally included benchmarking file
mattcieslak Aug 7, 2026
03008b6
Run the new interface tests in a temp dir, not the source tree
mattcieslak Aug 10, 2026
bfb7ca2
Satisfy the pinned ruff
mattcieslak Aug 10, 2026
6a6eabf
Merge branch 'tortoiseproc' of /home/matt/projects/qsiprep into anat-…
mattcieslak Aug 10, 2026
864eddf
Fix the intramodal template runtime crashes
mattcieslak Aug 10, 2026
d89a3af
Forward settings= on the align-to-first branch
mattcieslak Aug 10, 2026
3d97984
Size every full-series DIFFPREP node from the data
mattcieslak Aug 10, 2026
a10ae9c
Name the TSNR map stat-tsnr_dwimap and ship its metadata
mattcieslak Aug 10, 2026
7cd1a94
Tidy the new CLI options
mattcieslak Aug 10, 2026
d4cbbc4
Cut comments down to rationale
mattcieslak Aug 10, 2026
d390bf5
Merge branch 'tortoiseproc' of /home/matt/projects/qsiprep into anat-…
mattcieslak Aug 10, 2026
4c8a150
Remove the vestigial rpe_series_shelled config key and its detector
mattcieslak Aug 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,10 @@ notebooks/*
.pixi/*
!.pixi/config.toml
.cursor/rules/cursorenv.mdc

# Stray nipype interface outputs from running interfaces by hand
/tsnr.nii.gz
/n4_weights.nii.gz
/template_agreement.nii.gz
/*_bias.nii.gz
/*.nii
34 changes: 34 additions & 0 deletions qsiprep/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,22 @@ def _bids_filter(value, parser):
action='store_true',
help='DEPRECATED: see --b1-biascorrect-stage',
)
g_conf.add_argument(
'--anat-biascorrect',
action='store',
choices=['n4', 'auto', 'none'],
default='n4',
help=(
'Whether to run N4 bias field correction on ANATOMICAL images. '
'Note this is separate from --b1-biascorrect-stage, which only governs '
'the DWIs. '
'"n4" (default) always runs it; scanner-side intensity normalization '
'(e.g. Siemens NORM) does not remove the need for it. '
'"none" never runs it. '
'"auto" skips it when the BIDS ImageType metadata contains "NORM", '
'which is how Siemens and others flag console-applied normalization.'
),
)
g_conf.add_argument(
'--b1-biascorrect-stage',
action='store',
Expand Down Expand Up @@ -593,6 +609,24 @@ def _bids_filter(value, parser):
'current default can be found here: '
'https://github.com/PennLINC/qsiprep/blob/main/qsiprep/data/diffprep_params.json',
)
g_moco.add_argument(
'--tortoise-gpu-cpu-ratio',
action='store',
type=int,
default=None,
help=(
'How many volumes DIFFPREP gives the GPU per pass, against one per CPU '
'thread, during motion and eddy correction. TORTOISE does not move the '
'series onto the GPU the way eddy_cuda does: it treats the GPU as one '
'more worker, so the number of passes is '
'ceil(nvolumes / (ngpus * ratio + omp-nthreads - ngpus)). '
'It describes the machine, not the data -- roughly how many volumes the '
'GPU gets through while one CPU core does one. Only worth setting when '
'the GPU is fast relative to the core count, since its influence falls '
'as --omp-nthreads rises (about 68%% of volumes at 8 cores, 19%% at 64). '
'Requires the patched TORTOISE. Unset leaves TORTOISE at its default of 15.'
),
)
g_moco.add_argument(
'--shoreline-iters',
action='store',
Expand Down
4 changes: 4 additions & 0 deletions qsiprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ class workflow(_Config):
Or make a template? Either 'iterative' or 'first'"""
b0_to_t1w_transform = None
"""Transformation model for intramodal registration."""
anat_biascorrect = None
"""Whether to N4-correct anatomicals: ``n4``, ``auto`` or ``none``."""
b1_biascorrect_stage = None
"""The stage of processing at which to apply B1 bias correction. Either "final" (after
resampling), "none" (skipped entirely) or "legacy" (before concatenation)."""
Expand Down Expand Up @@ -616,6 +618,8 @@ class workflow(_Config):
"""Process all dwis separately - do not attempt concatenation."""
shoreline_iters = None
"""How many iterations to run SHORELine."""
tortoise_gpu_cpu_ratio = None
"""Volumes the GPU takes per DIFFPREP pass; None leaves TORTOISE's default."""
unringing_method = None
"""Method for Gibbs-ringing removal. Either "none", "mrdegibbs" or "rpg"."""
use_syn_sdc = None
Expand Down
2 changes: 1 addition & 1 deletion qsiprep/data/io_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
],
"default_path_patterns": [
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}][_desc-{desc}]_{suffix<T1w|T2w|T1rho|T1map|T2map|T2star|FLAIR|FLASH|PDmap|PD|PDT2|dseg|inplaneT[12]|angio|imtcoreg>}.{extension<nii|nii.gz|json>|nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}][_desc-{desc}]_{suffix<T1w|T2w|T1rho|T1map|T2map|T2star|FLAIR|FLASH|PDmap|PD|PDT2|dseg|inplaneT[12]|angio|imtcoreg|dwiref>}.{extension<nii|nii.gz|json|tsv>|nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}]_from-{from}_to-{to}_mode-{mode<image|points>|image}_{suffix<xfm>|xfm}.{extension<txt|h5|mat>}",
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}]_desc-{desc}_{suffix<mask>|mask}.{extension<nii|nii.gz|json>|nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}]_label-{label}[_desc-{desc}]_{suffix<probseg>|probseg}.{extension<nii|nii.gz|json>|nii.gz}",
Expand Down
85 changes: 85 additions & 0 deletions qsiprep/data/unbiased_template_precise_Affine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"dimension": 3,
"float": true,
"winsorize_lower_quantile": 0.002,
"winsorize_upper_quantile": 0.998,
"collapse_output_transforms": true,
"write_composite_transform": false,
"use_histogram_matching": [
false,
false
],
"transforms": [
"Rigid",
"Affine"
],
"number_of_iterations": [
[
1000,
1000
],
[
1000
]
],
"output_warped_image": true,
"transform_parameters": [
[
0.2
],
[
0.15
]
],
"convergence_threshold": [
1e-06,
1e-06
],
"convergence_window_size": [
20,
20
],
"metric": [
"Mattes",
"Mattes"
],
"sampling_percentage": [
0.15,
0.2
],
"sampling_strategy": [
"Random",
"Random"
],
"smoothing_sigmas": [
[
8.0,
2.0
],
[
2.0
]
],
"sigma_units": [
"mm",
"mm"
],
"metric_weight": [
1.0,
1.0
],
"shrink_factors": [
[
2,
1
],
[
1
]
],
"radius_or_number_of_bins": [
48,
48
],
"interpolation": "BSpline"
}
63 changes: 63 additions & 0 deletions qsiprep/data/unbiased_template_precise_Rigid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"dimension": 3,
"float": true,
"winsorize_lower_quantile": 0.002,
"winsorize_upper_quantile": 0.998,
"collapse_output_transforms": true,
"write_composite_transform": false,
"use_histogram_matching": [
false
],
"transforms": [
"Rigid"
],
"number_of_iterations": [
[
1000,
1000
]
],
"output_warped_image": true,
"transform_parameters": [
[
0.2
]
],
"convergence_threshold": [
1e-06
],
"convergence_window_size": [
20
],
"metric": [
"Mattes"
],
"sampling_percentage": [
0.15
],
"sampling_strategy": [
"Random"
],
"smoothing_sigmas": [
[
8.0,
2.0
]
],
"sigma_units": [
"mm"
],
"metric_weight": [
1.0
],
"shrink_factors": [
[
2,
1
]
],
"radius_or_number_of_bins": [
48
],
"interpolation": "BSpline"
}
85 changes: 85 additions & 0 deletions qsiprep/data/unbiased_template_sloppy_Affine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"dimension": 3,
"float": true,
"winsorize_lower_quantile": 0.002,
"winsorize_upper_quantile": 0.998,
"collapse_output_transforms": true,
"write_composite_transform": false,
"use_histogram_matching": [
false,
false
],
"transforms": [
"Rigid",
"Affine"
],
"number_of_iterations": [
[
10,
10
],
[
10
]
],
"output_warped_image": true,
"transform_parameters": [
[
0.2
],
[
0.15
]
],
"convergence_threshold": [
1e-06,
1e-06
],
"convergence_window_size": [
20,
20
],
"metric": [
"Mattes",
"Mattes"
],
"sampling_percentage": [
0.05,
0.05
],
"sampling_strategy": [
"Random",
"Random"
],
"smoothing_sigmas": [
[
8.0,
2.0
],
[
2.0
]
],
"sigma_units": [
"mm",
"mm"
],
"metric_weight": [
1.0,
1.0
],
"shrink_factors": [
[
2,
1
],
[
1
]
],
"radius_or_number_of_bins": [
48,
48
],
"interpolation": "BSpline"
}
63 changes: 63 additions & 0 deletions qsiprep/data/unbiased_template_sloppy_Rigid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"dimension": 3,
"float": true,
"winsorize_lower_quantile": 0.002,
"winsorize_upper_quantile": 0.998,
"collapse_output_transforms": true,
"write_composite_transform": false,
"use_histogram_matching": [
false
],
"transforms": [
"Rigid"
],
"number_of_iterations": [
[
10,
10
]
],
"output_warped_image": true,
"transform_parameters": [
[
0.2
]
],
"convergence_threshold": [
1e-06
],
"convergence_window_size": [
20
],
"metric": [
"Mattes"
],
"sampling_percentage": [
0.05
],
"sampling_strategy": [
"Random"
],
"smoothing_sigmas": [
[
8.0,
2.0
]
],
"sigma_units": [
"mm"
],
"metric_weight": [
1.0
],
"shrink_factors": [
[
2,
1
]
],
"radius_or_number_of_bins": [
48
],
"interpolation": "BSpline"
}
Loading