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 space definitions from niworkflows #378

Merged
merged 4 commits into from
Dec 18, 2023
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
4 changes: 2 additions & 2 deletions aslprep/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def _build_parser():
from functools import partial
from pathlib import Path

from niworkflows.utils.spaces import OutputReferencesAction, Reference
from packaging.version import Version

from aslprep.cli.version import check_latest, is_flagged
from aslprep.utils.spaces import OutputReferencesAction, Reference

def _path_exists(path, parser):
"""Ensure a given path exists."""
Expand Down Expand Up @@ -624,7 +624,7 @@ def parse_args(args=None, namespace=None):
"""Parse args and run further checks on the command line."""
import logging

from aslprep.utils.spaces import Reference, SpatialReferences
from niworkflows.utils.spaces import Reference, SpatialReferences

parser = _build_parser()
opts = parser.parse_args(args, namespace)
Expand Down
6 changes: 3 additions & 3 deletions aslprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def load(cls, settings, init=True, ignore=None):
@classmethod
def get(cls):
"""Return defined settings."""
from aslprep.utils.spaces import Reference, SpatialReferences
from niworkflows.utils.spaces import Reference, SpatialReferences

out = {}
for k, v in cls.__dict__.items():
Expand Down Expand Up @@ -548,7 +548,7 @@ class workflow(_Config):
"""Skip brain extraction of the T1w image (default is ``force``, meaning that
*ASLPrep* will run brain extraction of the T1w)."""
spaces = None
"""Keeps the :py:class:`~aslprep.utils.spaces.SpatialReferences`
"""Keeps the :py:class:`~niworkflows.utils.spaces.SpatialReferences`
instance keeping standard and nonstandard spaces."""
use_bbr = None
"""Run boundary-based registration for ASL-to-T1w registration."""
Expand Down Expand Up @@ -745,7 +745,7 @@ def to_filename(filename):

def init_spaces(checkpoint=True):
"""Initialize the :attr:`~workflow.spaces` setting."""
from aslprep.utils.spaces import Reference, SpatialReferences
from niworkflows.utils.spaces import Reference, SpatialReferences

spaces = execution.output_spaces or SpatialReferences()
if not isinstance(spaces, SpatialReferences):
Expand Down
13 changes: 1 addition & 12 deletions aslprep/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
"""Utility functions for aslprep."""
from aslprep.utils import (
asl,
atlas,
bids,
cbf,
confounds,
misc,
plotting,
sentry,
spaces,
)
from aslprep.utils import asl, atlas, bids, cbf, confounds, misc, plotting, sentry

__all__ = [
"asl",
Expand All @@ -20,5 +10,4 @@
"misc",
"plotting",
"sentry",
"spaces",
]
Loading