Skip to content

Commit

Permalink
Add templateflow to DatasetLinks.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Apr 1, 2024
1 parent 123c3f8 commit 258791c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion fmriprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
import os
from multiprocessing import set_start_method

from templateflow.conf import TF_LAYOUT

# Disable NiPype etelemetry always
_disable_et = bool(os.getenv('NO_ET') is not None or os.getenv('NIPYPE_NO_ET') is not None)
os.environ['NIPYPE_NO_ET'] = '1'
Expand Down Expand Up @@ -525,7 +527,10 @@ def _process_value(value):
for k, v in filters.items():
cls.bids_filters[acq][k] = _process_value(v)

dataset_links = {'raw': cls.bids_dir}
dataset_links = {
'raw': cls.bids_dir,
'templateflow': Path(TF_LAYOUT.root),
}
for deriv_name, deriv_path in cls.derivatives.items():
dataset_links[deriv_name] = deriv_path
cls.dataset_links = dataset_links
Expand Down
1 change: 1 addition & 0 deletions fmriprep/workflows/bold/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ def init_bold_wf(
]),
(inputnode, ds_bold_std_wf, [
('anat2std_xfm', 'inputnode.anat2std_xfm'),
('std_t1w', 'inputnode.template'),
('std_space', 'inputnode.space'),
('std_resolution', 'inputnode.resolution'),
('std_cohort', 'inputnode.cohort'),
Expand Down
4 changes: 3 additions & 1 deletion fmriprep/workflows/bold/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ def init_ds_volumes_wf(
'bold_mask', # boldref space
'bold_ref', # boldref space
't2star', # boldref space
'template', # target reference image from original transform
# Anatomical
'boldref2anat_xfm',
# Template
Expand All @@ -749,7 +750,7 @@ def init_ds_volumes_wf(

sources = pe.Node(
BIDSURI(
numinputs=3,
numinputs=4,
dataset_links=config.execution.dataset_links,
out_dir=str(config.execution.fmriprep_dir.absolute()),
),
Expand All @@ -776,6 +777,7 @@ def init_ds_volumes_wf(
('source_files', 'in1'),
('boldref2anat_xfm', 'in2'),
('anat2std_xfm', 'in3'),
('template', 'in4'),
]),
(inputnode, boldref2target, [
# Note that ANTs expects transforms in target-to-source order
Expand Down

0 comments on commit 258791c

Please sign in to comment.