SITK-IBEX: Aligning images acquired with the IBEX microscopy imaging technique
This Python package implementation is part of the development of the Iterative Bleaching Extends Multiplexity (IBEX) imaging technique. It enables the alignment of multiple cycles of fluorescence images, acquired using IBEX. A repeated marker is used to register all panels to a selected panel (in the registration nomenclature this is the fixed image). After registration all panels are resampled onto the fixed image.
More information about the development of the IBEX technique can be found in the IBEX Imaging Community, which is a community of researchers who are developing the IBEX knowledge-base of reagents, protocols, panels, publications, software, and datasets.
While this method was developed for a specific imaging protocol, it will likely work for other sequential protocols that contain a repeated marker. The registration approach is implemented using the SimpleITK toolkit registration framework.
The key implementation aspects include:
Multi-phase based approach with robust initialization.
Multi-resolution and point sampling.
Affine transformation model.
Use of correlation as optimized similarity metric.
Build Status
Installation
The Python module is distributed on PyPI - The Python Package Index. The package can be installed by running:
python -m pip install sitkibex[zarr]
Wheels from the main branch can be download wheel from Github Actions in the “python-package” artifact.
Dependencies are conventionally specified in pyproject.toml and requirements.txt and therefore installed as dependencies when the wheel is installed. This includes the SimpleITK 2.0 requirement. The optional “zarr” dependency is required for reading OME-NGFF ZARR files, and may be omitted if not needed.
The sitkibex script can also be installed and managed by pipx or uv. For example, to run and automatically install the latest version of sitkibex, you can use:
uvx sitkibex --help
Data
Sample data is available and described on Zenodo:
Any image and transform file format supported by SimpleITK’s IO can be used by sitk-ibex. The NRRD or NGFF image formats, and txt transform file extension are recommended.
Example
The following examples uses CD4 marker channel extracted from the “IBEX4_spleen” data set with ImageJ. The panel 2 is used as the reference coordinates or the “fixed image”. The other panels are registered then resampled to the fixed image. The following uses the sitk-ibex command line interface to perform image registration:
python -m sitkibex registration --affine "spleen_panel2.nrrd@CD4 AF594" "spleen_panel1.nrrd@CD4 AF594" tx_p2_to_p1.txt python -m sitkibex registration --affine "spleen_panel2.nrrd@CD4 AF594" "spleen_panel3.nrrd@CD4 AF594" tx_p2_to_p3.txt
A quick 2D visualization of the results can be generated with:
python -m sitkibex resample "spleen_panel2.nrrd@CD4 AF594" "spleen_panel1.nrrd@CD4 AF594" tx_p2_to_p1.txt \
--bin 4 --fusion --projection -o spleen_onto_p2_2d_Panel1.png
python -m sitkibex resample "spleen_panel2.nrrd@CD4 AF594" "spleen_panel3.nrrd@CD4 AF594" tx_p2_to_p3.txt \
--bin 4 --fusion --projection -o spleen_onto_p2_2d_Panel3.png
The above image fusion renders the fixed image as magenta and the moving as cyan, so when the two are aligned the results are white.
Then apply the registration transform by resampling all channels of the the input images onto panel 2:
python -m sitkibex resample "spleen_panel2.nrrd@CD4 AF594" spleen_panel2.nrrd tx_p2_to_p1.txt \
-o spleen_onto_p2_panel1.nrrd
python -m sitkibex resample "spleen_panel2.nrrd@CD4 AF594" spleen_panel3.nrrd tx_p2_to_p3.txt \
-o spleen_onto_p2_panel3.nrrd
Additional Example
Additional sample data:
The sample Imaris files can be converted to OME-NGFF ZARR with bioformats2raw. The ims files contains one series, and for simplicity, the structure is generated without a series index in the hierarchy with the following commands:
bioformats2raw --series 0 --scale-format-string '%2$d/' Human_Spleen_Panel1.ims Human_Spleen_Panel1.zarr bioformats2raw --series 0 --scale-format-string '%2$d/' Human_Spleen_Panel2.ims Human_Spleen_Panel2.zarr bioformats2raw --series 0 --scale-format-string '%2$d/' Human_Spleen_Panel2.ims Human_Spleen_Panel3.zarr
These images will be registered based on the common “Hoechst”. The name of the channels are lost in this conversion from Imaris to OME-NGFF ZARR. Some conversions produce “omera” metadata in the ZARR file which contains channel labels, which can be used. When the channel labels are unavailable, the channel index can be used such as the following commands:
python -m sitkibex registration --affine "Human_Spleen_Panel2.zarr@3" "Human_Spleen_Panel1.zarr@2" tx_p2_to_p1.txt python -m sitkibex registration --affine "Human_Spleen_Panel2.zarr@3" "Human_Spleen_Panel3.zarr@4" tx_p2_to_p3.txt
The quick 2D visualization can be run similarly to the NRRD example. The OME-NGFF ZARR files are not supported for writing, so the resample command can produce NRRD files as well.
How to Cite
If you use the SITK-IBEX package in your work, please cite us:
A. J. Radtke, E. F. Kandov, B. C. Lowekamp, E. Speranza, C. Chu, A. Gola, N. Thakur, R. Shih, L. Yao, Z. R. Yaniv, R. Beuschel, J. Kabat, J. Croteau, J. Davis, J. M. Hernandez, R. N. Germain “IBEX - A versatile multi-plex optical imaging approach for deep phenotyping and spatial analysis of cells in complex tissues”, Proc Natl Acad Sci, 117(52):33455-33465, 2020, doi:10.1073/pnas.2018488117.
Documentation
The published Sphinx documentation is available here: https://niaid.github.io/sitk-ibex/
The main built Sphinx documentation is available for download from Github Actions under the build as “sphinx-docs”.
Contact
Please use the GitHub Issues for support and code issues related to the sitk-ibex project.
Metadata
Release files for sitkibex 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sitkibex-0.5.3.tar.gz | 1.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sitkibex-0.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.6 MB
Release files / sitkibex-0.5.3.tar.gz
| Download URL | sitkibex-0.5.3.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cb8f304d1b8a84f37ee7d0f33e8af0ad5f6ae5c7ffd85af4a191c5e7caa032a
|
|
BLAKE2b-256 checksum How to use checksums |
cc2e3982fbcd9854d3b13797662c4a7b76cad31ddc630cb2912ad8fc7cb9b70d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 7, 2025.
Transparency logRelease files / sitkibex-0.5.3-py3-none-any.whl
| Download URL | sitkibex-0.5.3-py3-none-any.whl |
|---|---|
| Size | 30.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03d1607150b71a37c6662935571802aef12b3641fea041c72cd7ee47e877a62f
|
|
BLAKE2b-256 checksum How to use checksums |
e65e2518f1d9ea05b6bcaf7ccfe7dd32dc4d620a29c0536eb3e2e8c9611751b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 7, 2025.
Transparency log