Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions fmriprep/interfaces/multiecho.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ class T2SMapInputSpec(CommandLineInputSpec):
'monoexponential model is fit to the raw data.'
),
)
n_exclude = traits.Int(
argstr='--exclude %s',
position=5,
desc='Number of volumes from the beginning of the run to exclude from T2*/S0 estimation.',
)


class T2SMapOutputSpec(TraitedSpec):
Expand Down Expand Up @@ -103,6 +108,9 @@ class T2SMap(CommandLine):
def _format_arg(self, name, trait_spec, value):
if name == 'echo_times':
value = [te * 1000 for te in value]
if name == 'n_exclude':
# Convert to a range
value = f'0:{value}'
return super()._format_arg(name, trait_spec, value)

def _list_outputs(self):
Expand Down
5 changes: 4 additions & 1 deletion fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,10 @@ def init_bold_native_wf(
# Do NOT set motion_xfm on outputnode
# This prevents downstream resamplers from double-dipping
workflow.connect([
(inputnode, bold_t2s_wf, [('bold_mask', 'inputnode.bold_mask')]),
(inputnode, bold_t2s_wf, [
('bold_mask', 'inputnode.bold_mask'),
('dummy_scans', 'inputnode.skip_vols'),
]),
(boldref_bold, join_echos, [('out_file', 'bold_files')]),
(join_echos, bold_t2s_wf, [('bold_files', 'inputnode.bold_file')]),
(join_echos, outputnode, [('bold_files', 'bold_echos')]),
Expand Down
10 changes: 8 additions & 2 deletions fmriprep/workflows/bold/t2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def init_bold_t2s_wf(
The optimally combined time series was carried forward as the *preprocessed BOLD*.
"""

inputnode = pe.Node(niu.IdentityInterface(fields=['bold_file', 'bold_mask']), name='inputnode')
inputnode = pe.Node(
niu.IdentityInterface(fields=['bold_file', 'bold_mask', 'skip_vols']),
name='inputnode',
)

outputnode = pe.Node(niu.IdentityInterface(fields=['bold', 't2star_map']), name='outputnode')

Expand All @@ -122,7 +125,10 @@ def init_bold_t2s_wf(
)
workflow.connect([
(inputnode, dilate_mask, [('bold_mask', 'in_mask')]),
(inputnode, t2smap_node, [('bold_file', 'in_files')]),
(inputnode, t2smap_node, [
('bold_file', 'in_files'),
('skip_vols', 'n_exclude'),
]),
(dilate_mask, t2smap_node, [('out_mask', 'mask_file')]),
(t2smap_node, outputnode, [('optimal_comb', 'bold'),
('t2star_map', 't2star_map')]),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies = [
"requests >= 2.27",
"sdcflows >= 2.15.0",
"smriprep >= 0.19.2",
"tedana >= 25.0.0",
"tedana >= 25.1.0",
"templateflow >= 24.2.2",
"transforms3d >= 0.4.2",
"toml >= 0.10",
Expand Down
Loading