fastPLI: A Fiber Architecture Simulation Toolbox for 3D-PLI


section_content: 3D Polarized Light Imaging (3D-PLI) is a microscopic neuroimaging technique used to study the nerve fiber architecture in unstained histological brain sections at the micrometer scale (Axer et al., 2011). It provides image contrast for fibers and fiber tracts, and ultimately enables reconstruction of 3D nerve fiber orientations. The physical effect behind 3D-PLI is the optical property of the nerve fibers called birefringence. Due to this intrinsic birefringence, it is possible to use polarized light, pass it through a thin brain section and observe the change of the polarization state of light. This change is directly related to the 3D orientation of the fibers and also provides strong contrasts between fibers and other tissue components. 

To understand the influence of the underlying fiber structure, simulations are an essential tool. They allow testing different hypotheses, knowing the ground truth. It has already been shown that simulations with scattered light within tissue sections require models with irregularities to mimic the behavior of the scattered light. This knowledge can now be used to understand structures such as fiber crossings that have been difficult to interpret in 3D-PLI (Menzel et al., 2020). 

In addition, the generated nerve fiber models can be used in other imaging simulation techniques such as diffusion magnetic resonance imaging (dMRI). 

In recent years, various software tools have been developed to design fibre models. Nerve fiber modeling is commonly used in dMRI. But many modeling techniques do not use volumetric representations, especially collision-free ones. In the last decade, an increasing number of algorithms for non-trivial overlapping structures have been developed (Altendorf & Jeulin, 2011; Chapelle et al., 2015; Ginsburger et al., 2019; Mingasson et al., 2017). While these algorithms are specialized in their field, fastPLI also provides a dedicated tool for 3D-PLI simulation based on linear optics. Here, the focus is on the previously developed algorithm (Matuschke et al., 2019), which provides a fast method to generate collision-free results for white matter structures in the brain. 

Different types of simulations for polarized light are for example described in (Jiang & Li, 2020; RamellaRoman2005; Turnhout et al., 2009). However, to our knowledge, none of these techniques have been used to simulate the effects of polarized light on nerve fibers, except simPLI (Dohmen et al., 2015), which is included in this toolbox.
section_name: Statement of need

section_content: fastPLI is an open source toolbox based on Python and C++ for modeling myelinated axons, i. e. nerve fibers and simulating the results of measurement of fiber orientations with a polarization microscope using 3D-PLI. 

The fastPLI package includes the following modules:

1. Fiber Modelling Modules: A detailed 3D modelling of nerve fibers at the micrometer level is essential as input for the measurement simulation. In order to recreate biological tissue as a model, it is important that the nerve fibers do not spatially overlap. We have decided to implement a solver module that takes any configuration of fiber bundles as input and converts it over several iterations into a collision-free configuration. In order to generate collision free fiber arrangements, a dedicated algorithm to prohibit such overlaps has been developed (Matuschke et al., 2019).
section_name: Summary

section_content: The 3D-PLI simulation is based on Stokes vector and Müller matrix approaches as described in (Dohmen et al., 2015; Menzel et al., 2015). For the simulation the polarimetric setup can be equipped with a tiltable specimen stage (Axer et al., 2011; Schmitz et al., 2018). By this means the brain section can be scanned from oblique views which adds important information to unambiguously analyze the 3D fiber orientation. 

3. Analysis Module: The resulting simulated measurements (i. e., image stacks of a section acquired at different polarizing filter rotation angles and, optionally, at different oblique views) can be processed similarly to the real, experimental 3D-PLI (Axer et al., 2011; Schmitz et al., 2018). 

All computationally intensive calculations are optimized either with numba on the Python side or with multithreading C++ algorithms, which can be accessed via pybind11 inside the Python package (Jakob et al., 2017; Lam et al., 2015). Additionally, the simulation module supports the Message Passing Interface (MPI) to facilitate the simulation of very large volumes on multiple computer nodes.
section_name: Simulation Module:

section_content: The fastPLI package has to be built with a C++17 compiler. A Makefile allows a simple local installation. It generates the necessary libraries inside a build folder and a matching setup. py file, which can be used for a second installation process with pip. 

make fastpli pip3 install. 

All necessary configurations are handled in the background with CMake. All required software libraries are listed in the software repository.
section_name: Installation

section_content: A more detailed description of fastPLI including examples, jupyter notebooks and tutorials can be found in the software package, 1 at the wiki pages 2 and the API documentation.
section_name: Usage & Examples

section_content: Two modules exist to allow the user to build non-colliding white matter nerve fiber models: fastpli. model. sandbox and fastpli. model. solver. 

The fastpli. model. sandbox module contains multiple functions to build from coordinates single individual fibers up to fiber bundles composed of individual fibers. 

The fastpli. model. solver module contains a Solver class to generate non-colliding fibers constellations from an initial input dataset (Matuschke et al., 2019). 

An example of the solving process is shown in fig. 1 a ). The red colored segments indicate that a collision with this segment is detected. With further iterations, the number of collisions decreases. At the end, a collision-free configurations results. Figure 1 b) shows the crosssection through the resulting fiber configuration. Each fiber bundle has a different gray value.
section_name: Fiber Modelling

section_content: The module fastpli. simulation contains the class Simpli. This class contains all tools required to simulate the 3D-PLI setup (Dohmen et al., 2015; Menzel et al., 2015) and to analyze the generated images. Final results include the stack of images as well as the derived modalities referred to as transmittance, direction, retardation, inclination, relative thickness, and 3D fiber orientation (FOM) maps (Schmitz et al., 2018). 

An example of the simulation results is shown in fig. 3
section_name: Simulation and Analysis

section_name: Acknowledgements

section_content: This study was funded by the European Union 's Horizon 2020 Research and Innovation Programme under Grant Agreement No. 785907 ( Human Brain Project SGA2 ) and No. 945539 ( Human Brain Project SGA3 ). We gratefully acknowledge the computing time granted through JARA-HPC on the supercomputer JURECA (Jülich Supercomputing Centre, 2018) at Forschungszentrum Jülich, Germany.
section_name: Acknowledgements

section_name: Author Contributions

section_content: F. M. developed the software and wrote the documentation. M. A. provided guidance throughout the project. K. A. and M. A. supervised the project. F. M. wrote the manuscript with input from all authors.
section_name: Author Contributions