CapraIBEX is a set of tools for analysing IBEX multiplex images after registration. Its main job is separating real marker signal from autofluorescence and bleed-through: real signal is bright in one channel, and the rest is bright in many. It has an interactive viewer for tuning that filter on every channel, and it segments nuclei with StarDist.
The selectivity viewer on a mouse brain section: original DAPI (left), selectivity weight (middle), filtered result (right). These screenshots are from a newer version of the viewer than the one in this repository, which has the same three panels but fewer controls.
scripts/selectivity_viewer.py: PyQt5 viewer with three synced panels (original, selectivity map, filtered), a channel dropdown, a filter-strength slider and zoom/panscripts/*_selectivity.py,scripts/*_sweep.py: batch selectivity filtering and parameter sweepsscripts/ibex_analysis.py: StarDist nuclear segmentation on the DAPI channel and per-cell intensitiesscripts/make_montage.py: tiles several stacks into one labelled multi-channel montage
pip install -r requirements.txtpython scripts/selectivity_viewer.pyThe viewer reads one registered IBEX stack from the repository root. The file name and the
channel list are set at the top of scripts/selectivity_viewer.py (TIF_PATH, ALL_CHANNELS);
edit them for your own data. Frame 0 is expected to be DAPI.
Real cell signal is bright in one specific channel. Autofluorescence and vessel bleed-through are bright across many channels. The selectivity metric uses this:
selectivity = target / (mean_of_other_channels + epsilon)
High selectivity means real signal; low selectivity means background. The filtered image is
target * normalized_selectivity.
The same filter on the Lectin channel (newer viewer version).

