Today, sharing pipelines across the community is still a complex issue. New technologies and standards, however, change our methods for better collaboration. Here we propose to integrate them seamlessly into the stable and popular SPM pipeline manager. The graphical user interface gives enough flexibility for understanding, modifying, creating and sharing the standard pipelines that are not available today. These pipelines can finally be run with a simple BIDS-app command on any computer.
Neuroimaging is undergoing a methodological mutation with new standards for data organization (Brain Imaging Data Structure, or BIDS) [1] or command line description (Boutiques) [2], and with the popularization of software containers technologies such as docker or singularity for easy software distribution. Using these solutions, fully automatic processing pipelines can be shared and reused easily with standard commands and without any installation of software. BIDS apps (https://github.com/BIDS-Apps), for instance, propose a list of analysis pipelines, installed on a Docker container, that can be reused easily by any other group on a BIDS compatible dataset. One major limitation of BIDS app or similar solution is the lack of flexibility and transparency: understanding, adapting, modifying and creating new pipelines requires advanced skills that hinder the use of these solutions.
Here, we propose to use the very popular and stable SPM batch system to build flexible and transparent pipelines (figure 1) that can (1) call any neuroimaging tool on any docker container, (2) parse a BIDS directory to perform individual or group analysis and (3) integrates a flexible quality control system. Note that the user still benefits from all the preexisting modules of SPM for building the pipeline (folder creation, reports, unarchiving files, statistical or preprocessing tools, custom Octave/Matlab function, advanced mathematical operations, etc...). Also note that the same strategy could be integrated into another pipeline manager such as PSOM [3], Nipype [4],
For this aim, new SPM modules have been developed. This open-source solution can be used for free on any platform (Windows, Mac or Linux), using the executables provided at the following link: https://github.com/tanguyduval/spm12.
System call to neuroimaging tools (e.g. FSL, ANTs, MRtrix, python scripts). Neuroimaging tools can be run locally or on a docker container using the generic module “System Call” (Figure 2) or by using the pre-filled module in the menu bar (Figure 3). For more flexibility, instead of installing all the dependencies of the entire pipeline on a single container, each step of the pipeline is instantiated on-the-fly on a user-specified Docker container. Figure 2 shows an example of a typical system call for fslmaths. Inputs (variables, options or files) are described in the general command line using the standard proposed in Boutiques [2]. Folders containing the inputs and outputs are automatically mounted on docker. Outputs are defined by the user and used for the dependency tree. Pre-filled modules can be saved to the menu bar, as shown in figure 3, and easily shared as a Boutiques descriptor.
BIDS parser. SPM includes a bids parser that reads and list imaging modalities, acquisition parameters, and details about the sessions, the subjects, and the dataset. Virtual outputs are automatically generated and are used in a dependency tree for the next modules (figure 4). Default virtual outputs are generated from a template proposed by the BIDS community (https://github.com/bids-standard/bids-starter-kit/tree/master/templates).
Report and quality control. A module has been integrated to generate a light HTML report for quality control. This module is based on the template proposed by the spinal cord toolbox team [5]. This module accepts the following features: 3D or multiple 3D volumes, 4D volumes, overlays. 3D data are converted into an image of 6 slices. 4D volumes are displayed as looping movies of 1s. Overlays are displayed as blinking semi-transparent images.
When ready for distribution, pipelines can be run on a large scale on clusters using the SPM docker container.
We would like to thank Benjamin Lemasson, Clément Brossard, Guillaume Flandin, and the network for multicentric study (REMI) for their fruitful discussions on these issues.
Financed by the HTE program.
[1] K.J. Gorgolewski et al., Scientific data, 2016, 3, 160044.
[2] T. Glatard et al., arXiv [cs.SE], 2017.
[3] P. Bellec et al., Frontiers in neuroinformatics, 2012, 6, 7.
[4] K. Gorgolewski et al., Frontiers in neuroinformatics, 2011, 5, 13.
[5] B. De Leener et al., NeuroImage, 2017, 145, 24.