Skip to content
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
9 changes: 5 additions & 4 deletions petprep/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,13 +583,14 @@ def _bids_filter(value, parser):
g_hmc.add_argument(
'--petref',
default='template',
choices=['template', 'twa', 'sum', 'first5min'],
choices=['template', 'twa', 'sum', 'first5min', 'auto'],
help=(
"Strategy for generating the PET reference. 'template' uses the "
"motion correction template, while 'twa' computes a time-weighted "
"average, 'sum' produces a summed image of the motion-corrected "
"series, and 'first5min' averages the early (0-5 minute) portion "
'of the acquisition.'
"of the acquisition. 'auto' evaluates multiple strategies to "
'select the best reference.'
),
)

Expand Down Expand Up @@ -788,8 +789,8 @@ def parse_args(args=None, namespace=None):
config.execution.log_level = int(max(25 - 5 * opts.verbose_count, logging.DEBUG))
config.from_dict(vars(opts), init=['nipype'])

config.workflow._petref_cli_set = '--petref' in argv
config.workflow._pet2anat_method_cli_set = '--pet2anat-method' in argv
config.workflow.petref_specified = '--petref' in argv
config.workflow.pet2anat_method_specified = '--pet2anat-method' in argv

if config.execution.session_label:
config.execution.bids_filters = config.execution.bids_filters or {}
Expand Down
2 changes: 1 addition & 1 deletion petprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ class workflow(_Config):
pet2anat_method_specified: bool = False
"""Flag indicating whether ``--pet2anat-method`` was explicitly provided."""
petref: str = 'template'
"""Strategy for building the PET reference (``'template'``, ``'twa'``, ``'sum'`` or ``'first5min'``)."""
"""Strategy for building the PET reference (``'template'``, ``'twa'``, ``'sum'``, ``'first5min'`` or ``'auto'``)."""
petref_specified: bool = False
"""Flag indicating whether ``--petref`` was explicitly provided."""
cifti_output = None
Expand Down
9 changes: 8 additions & 1 deletion petprep/interfaces/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,17 @@ class FunctionalSummaryInputSpec(TraitedSpec):
'twa',
'sum',
'first5min',
'auto',
mandatory=True,
desc='PET reference generation strategy',
)
requested_petref_strategy = traits.Enum(
'template', 'twa', 'sum', 'first5min', desc='User-requested PET reference strategy'
'template',
'twa',
'sum',
'first5min',
'auto',
desc='User-requested PET reference strategy',
)
hmc_disabled = traits.Bool(False, desc='Head motion correction disabled')

Expand Down Expand Up @@ -295,6 +301,7 @@ def _generate_segment(self):
'twa': 'Time-weighted average of motion-corrected series',
'sum': 'Summed motion-corrected series',
'first5min': 'Early (0-5 minute) average of motion-corrected series',
'auto': 'Automatically selected reference',
}
petref_strategy = reference_map.get(self.inputs.petref_strategy, 'Unknown')
requested = getattr(self.inputs, 'requested_petref_strategy', None)
Expand Down
Loading