Installation guide
Prerequisites
Before installing asltk, ensure you have the following:
- Python version 3.9 or higher:
You can verify your Python version by running:
python --version
- pip:
Ensure you have pip (Python's package installer) up to date. You can check this by running:
pip --version
If you need to upgrade pip, run:
python -m pip install --upgrade pip
Installing the Library
The asltk package is available on PyPI and can be installed easily using pip. To install the latest stable version, simply run:
Note
Even thought the asltk installation examples are assuming the pip command in Linux terminal commands, the tool is also able to be installed using other Python library managers, e.g. Conda or Poetry, and also being able to run on MacOS and Windows operating systems.
Info
Please be aware that the installation procedure of any Python library should be properly done using a virtual environment. Hence, in this manner, it is indicated to also proceed with the following command:
python3 pip install venv
python3 -m venv .venv
source .venv/bin/activate
pip install asltk
Verifying the Installation
After the installation process has been completed, you can verify that the library is correctly installed by importing it in Python:
pip freeze | grep asltk
If the installation was successful, this command should print the version number of asltk.
Optional Installation: Registration Module
The registration module enables image alignment and normalization to standard templates. This module is optional and requires Python 3.10 or higher.
To install asltk with registration support:
pip install asltk[registration]
If you encounter an error related to antspyx compatibility, ensure you're using Python 3.10 or higher:
python --version
Why is Registration Optional?
The registration module depends on antspyx, which requires Python 3.10+. By making it optional, asltk can run on Python 3.9, which is compatible with 3D Slicer and other environments with stricter Python version requirements.
What Functions Require Registration?
The following functions require the registration module:
- asltk.registration.space_normalization()
- asltk.registration.rigid_body_registration()
- asltk.registration.affine_registration()
- asltk.registration.apply_transformation()
- asltk.registration.asl_normalization.asl_template_registration()
- asltk.registration.asl_normalization.head_movement_correction()
If you try to use these functions without installing the registration module, you'll get a helpful error message with installation instructions.