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

Use BIDSURI in init_ds_boldmask_wf #3297

Merged
merged 3 commits into from
Jun 4, 2024
Merged
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
1 change: 0 additions & 1 deletion fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ def init_bold_fit_wf(
name='ds_coreg_boldref_wf',
)
ds_boldmask_wf = init_ds_boldmask_wf(
bids_root=layout.root,
output_dir=config.execution.fmriprep_dir,
desc='brain',
name='ds_boldmask_wf',
Expand Down
16 changes: 10 additions & 6 deletions fmriprep/workflows/bold/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from nipype.pipeline import engine as pe
from niworkflows.interfaces.fixes import FixHeaderApplyTransforms as ApplyTransforms
from niworkflows.utils.images import dseg_label
from smriprep.workflows.outputs import _bids_relative

from fmriprep import config
from fmriprep.config import DEFAULT_MEMORY_MIN_GB
Expand Down Expand Up @@ -474,7 +473,6 @@ def init_ds_boldref_wf(

def init_ds_boldmask_wf(
*,
bids_root,
output_dir,
desc: str,
name='ds_boldmask_wf',
Expand All @@ -488,8 +486,14 @@ def init_ds_boldmask_wf(
)
outputnode = pe.Node(niu.IdentityInterface(fields=['boldmask']), name='outputnode')

raw_sources = pe.Node(niu.Function(function=_bids_relative), name='raw_sources')
raw_sources.inputs.bids_root = bids_root
sources = pe.Node(
BIDSURI(
numinputs=1,
dataset_links=config.execution.dataset_links,
out_dir=str(config.execution.fmriprep_dir.absolute()),
),
name='sources',
)

ds_boldmask = pe.Node(
DerivativesDataSink(
Expand All @@ -504,12 +508,12 @@ def init_ds_boldmask_wf(
)

workflow.connect([
(inputnode, raw_sources, [('source_files', 'in_files')]),
(inputnode, sources, [('source_files', 'in1')]),
(inputnode, ds_boldmask, [
('boldmask', 'in_file'),
('source_files', 'source_file'),
]),
(raw_sources, ds_boldmask, [('out', 'RawSources')]),
(sources, ds_boldmask, [('out', 'Sources')]),
(ds_boldmask, outputnode, [('out_file', 'boldmask')]),
]) # fmt:skip

Expand Down