Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
808446c
ENH: Add atlas field and update config
mnoergaard Sep 9, 2025
c46bc3d
ENH: Create config.json for atlas
mnoergaard Sep 9, 2025
7cdc09e
ENH: Add init_atlas_wf function in atlas.py
mnoergaard Sep 9, 2025
0df7a34
ENH: Update workflow logic for atlas support
mnoergaard Sep 9, 2025
adc448f
ENH: Update DerivativesDataSink instantiation
mnoergaard Sep 9, 2025
67076b5
FIX: Update fit.py for entity handling
mnoergaard Sep 9, 2025
bc9bb1d
FIX: Update atlas config and add tests
mnoergaard Sep 9, 2025
ec1569d
FIX: Update atlas configuration in config.json
mnoergaard Sep 9, 2025
386997a
FIX: Add write_composite_transform to Registration
mnoergaard Sep 9, 2025
98fb2e5
FIX: Edit config.json for SUIT atlases
mnoergaard Sep 9, 2025
bf1683e
FIX: Update fetch_templates.py to implement fetch_SUIT
mnoergaard Sep 9, 2025
815eece
FIX: Edit _atlas_morph_tsv to add Path import + update registration …
mnoergaard Sep 9, 2025
d878c9c
FIX: Implement atlas configuration loading and connections
mnoergaard Sep 9, 2025
549c99e
FIX: Add optional input to workflow for transforms
mnoergaard Sep 9, 2025
c5f06cb
FIX: Load template from config.json
mnoergaard Sep 9, 2025
dee4461
FIX: Replace hard-coded warp lookup with dynamic name
mnoergaard Sep 9, 2025
20eb03b
FIX: Remove conditional around select_atlas_tpl_xfm
mnoergaard Sep 9, 2025
8f6fbb6
FIX: Update init_atlas_wf workflow inputs and connections
mnoergaard Sep 9, 2025
f3793a7
FIX: Update init_atlas_wf argument handling
mnoergaard Sep 9, 2025
0cc45ab
FIX: Make registration conditional at runtime
mnoergaard Sep 10, 2025
1857955
FIX: Update derivative collection and tests
mnoergaard Sep 10, 2025
4d08ed4
FIX: Refactor MNI152NLin2009cAsym transform retrieval
mnoergaard Sep 10, 2025
b4f9665
FIX: Extend niworkflows with SUIT support
mnoergaard Sep 10, 2025
a39aa50
FIX: Add datalad to project dependencies
mnoergaard Sep 10, 2025
e5b3c89
FIX: Add tpl2anat entry to collect derivatives
mnoergaard Sep 10, 2025
df59149
FIX: Update _atlas_morph_tsv for column filtering
mnoergaard Sep 10, 2025
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
12 changes: 12 additions & 0 deletions petprep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@
from ._version import __version__
except ImportError:
__version__ = '0+unknown'

# Ensure niworkflows recognizes the SUIT template.
try: # pragma: no cover - if niworkflows is unavailable, skip patching
from niworkflows.utils import spaces as _spaces

if 'SUIT' not in _spaces.Reference._standard_spaces:
_spaces.Reference._standard_spaces = (
*_spaces.Reference._standard_spaces,
'SUIT',
)
except Exception: # pragma: no cover
pass
11 changes: 11 additions & 0 deletions petprep/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,13 @@ def _bids_filter(value, parser):
help='Segmentation method to use.',
)

g_seg.add_argument(
'--atlas',
action='store',
default=None,
help='Atlas to use for segmentation instead of FreeSurfer.',
)

g_refmask = parser.add_argument_group('Options for reference mask generation')
g_refmask.add_argument(
'--ref-mask-name',
Expand Down Expand Up @@ -727,6 +734,10 @@ 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'])

if opts.atlas is not None:
config.workflow.atlas = opts.atlas
config.workflow.seg = None

pvc_vals = (opts.pvc_tool, opts.pvc_method, opts.pvc_psf)
if any(val is not None for val in pvc_vals) and not all(val is not None for val in pvc_vals):
parser.error('Options --pvc-tool, --pvc-method and --pvc-psf must be used together.')
Expand Down
18 changes: 18 additions & 0 deletions petprep/cli/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@ def test_parse_args(tmp_path, minimal_bids):
_reset_config()


def test_atlas_overrides_seg(tmp_path, minimal_bids):
"""Ensure --atlas sets atlas and disables segmentation."""
out_dir = tmp_path / 'out'
parse_args(
args=[
str(minimal_bids),
str(out_dir),
'participant',
'--skip-bids-validation',
'--atlas',
'MyAtlas',
]
)
assert config.workflow.atlas == 'MyAtlas'
assert config.workflow.seg is None
_reset_config()


def test_bids_filter_file(tmp_path, capsys):
bids_path = tmp_path / 'data'
out_path = tmp_path / 'out'
Expand Down
3 changes: 2 additions & 1 deletion petprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ class workflow(_Config):
seg = 'gtm'
"""Segmentation approach ('gtm', 'brainstem', 'thalamicNuclei',
'hippocampusAmygdala', 'wm', 'raphe', 'limbic')."""

atlas: str | None = None
"""Atlas defining regional segmentation. If set, FreeSurfer segmentation is skipped."""
pvc_tool: str | None = None
"""Tool used for partial volume correction."""
pvc_method: str | None = None
Expand Down
Loading
Loading