Python bindings for the Numerics88 AimIO C++ library.
aimio-py provides a small Python API to read and write AIM files as NumPy arrays, read ISQ files, inspect metadata, and work with processing logs.
- Read AIM files into NumPy arrays
- Write AIM files from NumPy arrays
- Read ISQ files into NumPy arrays
- Access AIM and ISQ header metadata (
aim_info,isq_info) - Convert processing logs between text and dictionary formats
- Optional density/HU conversion helpers
From PyPI (recommended):
pip install aimio-pyFrom source:
git clone https://github.com/wallematthias/aimio-py.git
cd aimio-py
git submodule update --init --recursive
pip install -e .from py_aimio import read_aim, read_isq, write_aim
array, meta = read_aim("scan.AIM")
write_aim("copy.AIM", array, meta)
isq_array, isq_meta = read_isq("scan.ISQ")from py_aimio import isq_info, read_isq
info = isq_info("scan.ISQ")
print("Dimensions:", info["dimensions"])
print("Voxel spacing:", info["spacing"])
array, meta = read_isq("scan.ISQ")
print(array.shape, array.dtype) # (z, y, x), int16aim_info(path)isq_info(path)read_aim(path, density=False, hu=False) -> (array, meta)read_isq(path) -> (array, meta)write_aim(path, array, meta=None, unit=None)get_aim_density_equation(processing_log)get_aim_hu_equation(processing_log)log_to_dict(log)dict_to_log(dct)
Run tests:
pytest -qRun tests with coverage:
pytest -q --cov=py_aimio --cov-report=term-missing --cov-report=xml:coverage.xmlBuild local artifacts:
python -m build --wheel --sdistBuild documentation from docstrings:
pip install sphinx
make -C docs htmlGenerated HTML will be in docs/build/html/index.html.
This project depends on the external/AimIO and external/n88util git submodules. If they are missing, extension builds will fail.
py_aimio/calibration.pyis adapted from Bonelab/Bonelab.py_aimio/header_log.pyis by Matthias Walle.
MIT