diff --git a/brainles_preprocessing/registration/__init__.py b/brainles_preprocessing/registration/__init__.py index 0550373..70b18fd 100644 --- a/brainles_preprocessing/registration/__init__.py +++ b/brainles_preprocessing/registration/__init__.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index f824fb1..a7e5b42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,6 @@ classifiers = [ "Operating System :: OS Independent", ] - [tool.poetry.dependencies] python = "^3.10" # core @@ -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"