Skip to content
Closed
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
4 changes: 2 additions & 2 deletions docs/outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ from an anatomical segmentation. The resulting table has ``FrameTimesStart`` and

sub-<subject_label>/
pet/
sub-<subject_label>_[specifiers]_seg-<seg>_desc-preproc_timeseries.tsv
sub-<subject_label>_[specifiers]_seg-<seg>_desc-preproc_tacs.tsv

The ``desc-preproc`` entity indicates that the curves were derived from the
preprocessed PET series.
Expand All @@ -323,7 +323,7 @@ table containing the mean uptake within that region::

sub-<subject_label>/
pet/
sub-<subject_label>_[specifiers]_seg-<seg>_ref-<ref>_desc-preproc_timeseries.tsv
sub-<subject_label>_[specifiers]_seg-<seg>_ref-<ref>_desc-preproc_tacs.tsv

The ``ref`` entity captures the reference region identifier provided via the
:ref:`CLI options <cli_refmask>` ``--ref-mask-name`` and ``--ref-mask-index``.
Expand Down
14 changes: 7 additions & 7 deletions petprep/data/nipreps.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@
"sub-{subject}[/ses-{session}]/{datatype<perf>|perf}/sub-{subject}[_ses-{session}][_task-{task}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}][_atlas-{atlas}][_cohort-{cohort}][_desc-{desc}]_{suffix<timeseries>}{extension<.json|.tsv>|.tsv}",
"sub-{subject}[/ses-{session}]/{datatype<perf>|perf}/sub-{subject}[_ses-{session}][_task-{task}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}][_atlas-{atlas}][_cohort-{cohort}][_desc-{desc}]_{suffix<asl|aslref|att|cbf|coverage|mask>}{extension<.nii|.nii.gz|.json|.tsv>|.tsv}",
"sub-{subject}[/ses-{session}]/{datatype<fmap>|fmap}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_dir-{direction}][_run-{run}][_part-{part}][_space-{space}][_cohort-{cohort}][_res-{resolution}][_fmapid-{fmapid}][_desc-{desc}]_{suffix<fieldmap>}{extension<.nii|.nii.gz|.json>|.nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_trc-{tracer}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}][_desc-{desc}]_{suffix<pet|petref>}{extension<.nii|.nii.gz|.json>|.nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_trc-{tracer}][_rec-{reconstruction}][_run-{run}][_hemi-{hemi<L|R>}]_from-{from}_to-{to}_mode-{mode<image|points>|image}_{suffix<xfm>|xfm}{extension<.txt|.h5>}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_trc-{tracer}][_rec-{reconstruction}][_run-{run}]_hemi-{hemi<L|R>}[_space-{space}][_cohort-{cohort}][_den-{density}][_desc-{desc}]_{suffix<white|smoothwm|pial|midthickness|inflated|vinflated|sphere|flat|sulc|curv|thickness>}{extension<.surf.gii|.shape.gii>}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_trc-{tracer}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_den-{density}][_desc-{desc}]_{suffix<sulc|curv|thickness>}{extension<.dscalar.nii|.json>}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_trc-{tracer}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}]_desc-{desc}_{suffix<mask>|mask}{extension<.nii|.nii.gz|.json>|.nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_trc-{tracer}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}]_label-{label}[_desc-{desc}]_{suffix<probseg>|probseg}{extension<.nii|.nii.gz|.json>|.nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_trc-{tracer}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_part-{part}][_space-{space}][_atlas-{atlas}][_cohort-{cohort}][_desc-{desc}]_{suffix<timeseries|regressors>|timeseries}{extension<.json|.tsv>|.tsv}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}][_desc-{desc}]_{suffix<pet|petref>}{extension<.nii|.nii.gz|.json>|.nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_hemi-{hemi<L|R>}]_from-{from}_to-{to}_mode-{mode<image|points>|image}_{suffix<xfm>|xfm}{extension<.txt|.h5>}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}]_hemi-{hemi<L|R>}[_space-{space}][_cohort-{cohort}][_den-{density}][_desc-{desc}]_{suffix<white|smoothwm|pial|midthickness|inflated|vinflated|sphere|flat|sulc|curv|thickness>}{extension<.surf.gii|.shape.gii>}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_den-{density}][_desc-{desc}]_{suffix<sulc|curv|thickness>}{extension<.dscalar.nii|.json>}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}]_desc-{desc}_{suffix<mask>|mask}{extension<.nii|.nii.gz|.json>|.nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}]_label-{label}[_desc-{desc}]_{suffix<probseg>|probseg}{extension<.nii|.nii.gz|.json>|.nii.gz}",
"sub-{subject}[/ses-{session}]/{datatype<pet>|pet}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_part-{part}][_space-{space}][_atlas-{atlas}][_cohort-{cohort}][_desc-{desc}]_{suffix<timeseries|regressors|tacs>|timeseries}{extension<.json|.tsv>|.tsv}",
"sub-{subject}/{datatype<figures>}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_desc-{desc}]_{suffix<T1w|T2w|T1rho|T1map|T2map|T2star|FLAIR|FLASH|PDmap|PD|PDT2|inplaneT[12]|angio|dseg|mask|T2starw|MTw|TSE|pet>}{extension<.html|.svg>|.svg}",
"sub-{subject}/{datatype<figures>}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_fmapid-{fmapid}][_desc-{desc}]_{suffix<fieldmap>}{extension<.html|.svg>|.svg}",
"sub-{subject}/{datatype<figures>}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_echo-{echo}][_part-{part}][_space-{space}][_cohort-{cohort}][_desc-{desc}]_{suffix<dwi|epi|epiref|pet>}{extension<.html|.svg>|.svg}",
Expand Down
4 changes: 2 additions & 2 deletions petprep/interfaces/tacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _run_interface(self, runtime):

out_file = fname_presuffix(
self.inputs.in_file,
suffix='_timeseries.tsv',
suffix='_tacs.tsv',
newpath=runtime.cwd,
use_ext=False,
)
Expand Down Expand Up @@ -138,7 +138,7 @@ def _run_interface(self, runtime):

out_file = fname_presuffix(
self.inputs.in_file,
suffix='_timeseries.tsv',
suffix='_tacs.tsv',
newpath=runtime.cwd,
use_ext=False,
)
Expand Down
2 changes: 1 addition & 1 deletion petprep/interfaces/tests/test_tacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_tacs_workflow(tmp_path):
inputs = pickle.load(f)

assert inputs['in_file'] == str(resampled_pet)
assert Path(tmp_path / 'pet_tacs_wf' / 'tac' / 'pet_resampled_timeseries.tsv').exists()
assert Path(tmp_path / 'pet_tacs_wf' / 'tac' / 'pet_resampled_tacs.tsv').exists()


def test_ExtractRefTAC(tmp_path):
Expand Down
1 change: 1 addition & 0 deletions petprep/utils/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def write_bidsignore(deriv_dir):
'*_pet.pet.gii',
'*_mixing.tsv',
'*_timeseries.tsv',
'*_tacs.tsv',
)
ignore_file = Path(deriv_dir) / '.bidsignore'

Expand Down
8 changes: 4 additions & 4 deletions petprep/workflows/pet/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def init_pet_wf(
ds_pet_tacs = pe.Node(
DerivativesDataSink(
base_directory=petprep_dir,
suffix='timeseries',
suffix='tacs',
seg=config.workflow.seg,
desc='preproc',
allowed_entities=('seg',),
Expand All @@ -715,7 +715,7 @@ def init_pet_wf(
('outputnode.segmentation', 'inputnode.segmentation'),
('outputnode.dseg_tsv', 'inputnode.dseg_tsv'),
]),
(pet_tacs_wf, ds_pet_tacs, [('outputnode.timeseries', 'in_file')]),
(pet_tacs_wf, ds_pet_tacs, [('outputnode.tacs', 'in_file')]),
]) # fmt:skip

if config.workflow.ref_mask_name:
Expand All @@ -728,7 +728,7 @@ def init_pet_wf(
ds_ref_tacs = pe.Node(
DerivativesDataSink(
base_directory=petprep_dir,
suffix='timeseries',
suffix='tacs',
seg=config.workflow.seg,
desc='preproc',
ref=config.workflow.ref_mask_name,
Expand All @@ -747,7 +747,7 @@ def init_pet_wf(
workflow.connect([
(pet_t1w_src, pet_ref_tacs_wf, [(pet_t1w_field, 'inputnode.pet_anat')]),
(pet_fit_wf, pet_ref_tacs_wf, [('outputnode.refmask', 'inputnode.mask_file')]),
(pet_ref_tacs_wf, ds_ref_tacs, [('outputnode.timeseries', 'in_file')]),
(pet_ref_tacs_wf, ds_ref_tacs, [('outputnode.tacs', 'in_file')]),
]) # fmt:skip

if nvols > 1: # run these only if 4-D PET
Expand Down
2 changes: 1 addition & 1 deletion petprep/workflows/pet/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def init_pet_fit_wf(
ds_ref_tacs = pe.Node(
DerivativesDataSink(
base_directory=config.execution.petprep_dir,
suffix='timeseries',
suffix='tacs',
seg=config.workflow.seg,
desc='preproc',
ref=config.workflow.ref_mask_name,
Expand Down
4 changes: 2 additions & 2 deletions petprep/workflows/pet/ref_tacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def init_pet_ref_tacs_wf(*, name: str = 'pet_ref_tacs_wf') -> pe.Workflow:
niu.IdentityInterface(fields=['pet_anat', 'mask_file', 'metadata', 'ref_mask_name']),
name='inputnode',
)
outputnode = pe.Node(niu.IdentityInterface(fields=['timeseries']), name='outputnode')
outputnode = pe.Node(niu.IdentityInterface(fields=['tacs']), name='outputnode')

resample_pet = pe.Node(
Function(
Expand Down Expand Up @@ -57,7 +57,7 @@ def init_pet_ref_tacs_wf(*, name: str = 'pet_ref_tacs_wf') -> pe.Workflow:
('ref_mask_name', 'ref_mask_name'),
],
),
(tac, outputnode, [('out_file', 'timeseries')]),
(tac, outputnode, [('out_file', 'tacs')]),
]
)

Expand Down
4 changes: 2 additions & 2 deletions petprep/workflows/pet/tacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def init_pet_tacs_wf(*, name: str = 'pet_tacs_wf') -> pe.Workflow:
niu.IdentityInterface(fields=['pet_anat', 'segmentation', 'dseg_tsv', 'metadata']),
name='inputnode',
)
outputnode = pe.Node(niu.IdentityInterface(fields=['timeseries']), name='outputnode')
outputnode = pe.Node(niu.IdentityInterface(fields=['tacs']), name='outputnode')

# Resample PET to segmentation space
resample_pet = pe.Node(
Expand Down Expand Up @@ -68,7 +68,7 @@ def init_pet_tacs_wf(*, name: str = 'pet_tacs_wf') -> pe.Workflow:
('metadata', 'metadata'),
],
),
(tac, outputnode, [('out_file', 'timeseries')]),
(tac, outputnode, [('out_file', 'tacs')]),
]
)

Expand Down
Loading