Spectral Unmixing: A modular and reproducible Python package for directed and blind spectral unmixing in multidimensional microscopy stacks
Musacchio, F.; Fuhrmann, M.
Show abstract
Spectral bleed-through remains a persistent practical problem in multichannel fluorescence microscopy. Signal from one fluorophore can be recorded in the detection channel of another, thereby biasing intensity measurements, inflating apparent colocalization, and complicating the interpretation of dynamic microscopy data. Although many correction strategies exist, routine workflows often remain fragmented across ad hoc scripts, manually tuned graphical procedures, or method-specific blind-unmixing implementations with limited provenance. Here we present spectral-unmixing, an open-source Python package for reproducible linear spectral unmixing in multidimensional microscopy stacks. The package unifies directed two-channel correction with multiple alpha-estimation strategies, optional bidirectional two-channel correction through explicit inversion of a 2 x 2 mixing model, and PICASSO-family blind unmixing for multichannel data. Microscopy inputs are normalized at the API boundary to canonical TZCY X stacks, allowing the same unmixing code to be applied across file formats without manual axis handling. Machine-readable sidecar reports preserve the effective processing configuration and estimated coefficients for every output, so that workflows can be audited and reproduced. Synthetic and real-data-derived benchmarks show that the implemented workflows accurately estimate and correct bleed-through when their model assumptions are satisfied. In fixed-alpha two-channel simulations, the mean-ratio and linear-fit estimators recovered {approx} 0.283 for a ground-truth value of 0.28 and reduced target-channel normalized root mean squared error from approximately 0.029 to 0.003. In time-varying simulations, per-time-point estimation tracked coefficient drift substantially better than reference-time-point estimation. Bidirectional inversion recovered reciprocally mixed channels accurately when coefficients were known or well estimated. PICASSO-family benchmarks further showed a practical trade-off between reducing residual inter-channel dependence and preserving fluorophore identity, with MATLAB-style workflows behaving more conservatively and source-sink formulations providing stronger dependence suppression when meaningful directional priors are available. Together, these elements make spectral-unmixing a practical, transparent, and extensible platform for reproducible spectral unmixing of fluorescence microscopy data in neuroscience and other quantitative bioimage-analysis settings.
Matching journals
The top 4 journals account for 50% of the predicted probability mass.