Skip to content

Commit

Permalink
Make ants an optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
IsraMekki0 committed Mar 1, 2024
1 parent 8060dcc commit d2e2227
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion brainles_preprocessing/registration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
from .ANTs.ANTs import ANTsRegistrator
import warnings

try:
from .ANTs.ANTs import ANTsRegistrator
except ImportError:
warnings.warn(
"ANTS package not found. If you want to use it, please install it using 'pip install antspyx'"
)

from .niftyreg.niftyreg import NiftyRegRegistrator
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ classifiers = [
"Operating System :: OS Independent",
]


[tool.poetry.dependencies]
python = "^3.10"
# core
Expand All @@ -58,6 +57,12 @@ tqdm = "^4.64.1"
auxiliary = "^0.0.41"
rich = "^13.6.0"


antspyx = { version = "^0.4.2", optional = true }

[tool.poetry.extras]
ants = ["antspyx"]

[tool.poetry.dev-dependencies]
pytest = "^6.2"

Expand Down

0 comments on commit d2e2227

Please sign in to comment.