Neuroimaging Analysis Kit - Progress and challenges for
standardized fMRI processing
Pierre Bellec
pierre.bellec@criugm.qc.ca
Feindel Brain Imaging Lecture - BIC/MNI/McGill 2016/10
P. Bellec Mining brain networks Montr´eal 2016 1 / 34
What’s NIAK
The Neuroimaging Analysis Kit (NIAK):
a software package for data mining
of brain networks in large fMRI datasets.
◮ A catalogue of complete workflows.
◮ Scales for large datasets / analyses.
◮ Incorporates robust, valid methods.
◮ Free and open-source (MIT).
P. Bellec Mining brain networks Montr´eal 2016 2 / 34
Available pipelines
Check http://niak.simexp-lab.org for more info.
P. Bellec Mining brain networks Montr´eal 2016 3 / 34
fMRI preprocessing: flowchart
P. Bellec Mining brain networks Montr´eal 2016 4 / 34
Structural non-linear coregistration
P. Bellec Mining brain networks Montr´eal 2016 5 / 34
Structural processing: main outputs
raw T1 volume
non-uniformity corrected volume
brain mask
linear MNI152 template
non-linear MNI152 template
linear (lsq9) coregistered volume
non-linear coregistered volume
The main outputs of the T1 (CIVET) processing pipeline.
P. Bellec Mining brain networks Montr´eal 2016 6 / 34
T1 to BOLD image registrationCorrecttozeromean,smooth,eresample
Correcttozeromean,smooth
iteration 1 : large smoothing
iteration 5 : small smoothing
5 iterations progressive fit : LSQ6 coregistration - MINCTRACC (mutual information)
iteration 1 : large smoothing
iteration 5 : small smoothing
T1 volume & brain mask fMRI volume & brain mask
smooth : 8,4,8,4,3
step : 4,4,4,2,1
simplex : 8,4,2,2,1
smooth : 8,4,8,4,3
step : 4,4,4,2,1
simplex : 8,4,2,2,1
P. Bellec Mining brain networks Montr´eal 2016 7 / 34
Estimation of rigid-body motion over time
within-run motion parameters :
3 rotations
3 translations
for each volume
volume of reference (median)
time
time
P. Bellec Mining brain networks Montr´eal 2016 8 / 34
Scrubbing: frame displacement
Frame displacement is the sum of absolute displacements in translation and rotation motion
parameters. Frames with excessive FD (FD> 0.5) and neighbours are eliminated (Power et al.
Neuroimage 2012).
P. Bellec Mining brain networks Montr´eal 2016 9 / 34
Regression of confounds
P. Bellec Mining brain networks Montr´eal 2016 10 / 34
How does it work?
Main use case is based on Matlab/Octave. Tutorial available at http://
niak.simexp-lab.org/niak_tutorial_fmri_preprocessing.html,
also as a jupyter notebook.
P. Bellec Mining brain networks Montr´eal 2016 11 / 34
fMRI preprocessing: update
Notable features in upcoming NIAK “COG” release
◮ Dual support for MINC and NIFTI file formats.
◮ Minimally preprocessed data: resampled data is available along with
all available confounds, for further analysis in SPM, FSL, etc.
◮ Interactive fMRI preprocessing report.
◮ Simplified guidelines for quality control
P. Bellec Mining brain networks Montr´eal 2016 12 / 34
Interactive report
Reports can be consulted offline or online. Live demo at
https://simexp.github.io/qc_cobre/.
P. Bellec Mining brain networks Montr´eal 2016 13 / 34
Guidelines for quality control of brain registration
Simplified guildelines for quality control as well as a collection of images to
rate are available on zooniverse https://www.zooniverse.org/
projects/simexp/brain-mri-registration-quality-control
P. Bellec Mining brain networks Montr´eal 2016 14 / 34
One pipeline, many jobs...
Jobs and dependencies for fMRI preprocessing of two subjects with two functional runs each.
P. Bellec Mining brain networks Montr´eal 2016 15 / 34
The pipeline system for Octave and Matlab
NIAK is powered by PSOM, an open-source library for scripting pipelines
using Octave or Matlab (Bellec et al., Frontiers in Neuroinformatics,
2012).
◮ Parallel computing: Detection and execution of parallel components
in the pipeline. The same code can run in a variety of execution
environments (local, multi-core, cluster).
◮ Provenance tracking: Generation of a comprehensive record of the
pipeline stages and the history of execution.
◮ Fault tolerance: Multiple attempts will be made to run each job
before it is considered as failed. Failed jobs can be automatically
re-started.
◮ Smart updates: When an analysis is started multiple times, only the
parts of the pipeline that need to be reprocessed are executed.
http://psom.simexp-lab.org
P. Bellec Mining brain networks Montr´eal 2016 16 / 34
PSOM 1.0
PSOM 1.0 follows a basic submission design, where each available job gets
submitted for execution, with a maximum of N concurrent processes. Running J
jobs requires J submissions, regardless of N. Works inefficiently for large J and
short jobs in systems with large overhead for submission.
P. Bellec Mining brain networks Montr´eal 2016 17 / 34
Benchmark PSOM 1.0
Adapted from Bellec et al. Front. in NeuroInf. 2012.
◮ Dataset Cambridge, 198 subjects with T1/fMRI.
◮ 5153 jobs / 7.7 G raw input / 21 G output / 8348
unique input/output files.
◮ peuplier: single machine (i7, 4 cores / 8 threads),
local file system.
◮ magma: single machine (AMD, 24 cores), NFS file
system.
◮ guillimin: supercomputer (Xeon, 14k cores on 2011),
infiniband parallel file system.
◮ Efficiency went down from 90% on peuplier-8 to 60%
on guillimin-200.
P. Bellec Mining brain networks Montr´eal 2016 18 / 34
PSOM 2.0
PSOM 2.0, currently in beta, features an agent-based execution model. Running
N parallel processes requires N + 1 submissions, regardless of number of jobs J.
Works efficiently in systems with large overhead for submission, regardless of J
and job duration (1s+).
P. Bellec Mining brain networks Montr´eal 2016 19 / 34
Benchmark PSOM 2.0
◮ Dataset Human Connectome Project, 875 subjects with T1 + 7
mutliband fMRI task runs.
◮ 123k jobs / 3.4 T raw input / 3.8 T output / 173k unique
input/output files.
◮ guillimin: supercomputer (Xeon, 20k+ cores on 2016), infiniband
parallel file system.
◮ Up to 300 concurrent processes allowed.
◮ Serial time: 17.9k hours / 746.87 days. Parallel time: 70 hrs.
Parallelization efficiency: 85%
◮ deviation from 100% efficiency mostly attributable to queuing delays
in order to access resources.
P. Bellec Mining brain networks Montr´eal 2016 20 / 34
Integration with CBRAIN - frontend
The NIAK fMRI preprocessing pipeline, and soon the whole NIAK pipeline
catalogue, are integrated in CBRAIN.
P. Bellec Mining brain networks Montr´eal 2016 21 / 34
NIAK deployment using Docker
◮ The NIAK now ships as a docker container, available in docker hub
https://hub.docker.com/, as well as singularity
http://singularity.lbl.gov/, designed for high-performance
computing infrastructures.
◮ The container includes all dependencies (MINC-toolkit, Octave,
PSOM, NIAK, Brain Connectivity Toolbox, Jupyter).
◮ This facilitates installation on all platforms, CBRAIN, Linux, Mac,
Windows
http://niak.simexp-lab.org/niak_installation.html
P. Bellec Mining brain networks Montr´eal 2016 22 / 34
Integration with CBRAIN - backend
Lavoie-Courchesne et al., Journal of Physics: Conference Series 2011; Glatard et al., HBM 2016; Glatard et al., submitted to
Future Generation Computer Systems
P. Bellec Mining brain networks Montr´eal 2016 23 / 34
Integration with CBRAIN - BIDS support
Datasets fed into niak need to be organized using the Brain Imaging Data
Structure (BIDS) http://bids.neuroimaging.io/. Proper organization
can be validated on the CBRAIN portal.
Gorgolewski et al., Scientific Data 2016
P. Bellec Mining brain networks Montr´eal 2016 24 / 34
Challenge: pipeline development
A software package is a living organism.
Courtesy of Sam and Max.
Developping scientific workflows is
like signing for a game of whack a
mole (Courtesy of Alan Evans).
P. Bellec Mining brain networks Montr´eal 2016 25 / 34
Challenge: pipeline development
A worked example:
Courtesy of Sam and Max.
◮ Increase image resolution.
GOOD.
◮ Better inter-subject brain
alignment. GOOD.
◮ Thus, less spatial blurring is
needed. GOOD.
◮ Hence, random field theory
breaks down. FAIL.
P. Bellec Mining brain networks Montr´eal 2016 26 / 34
Challenge 2: OS/numerical instability
DICE coefficient between matched components from an ICA
decomposition across two runs executed on the same system.
(1) automatic detection of the number of components; (2) same random
seeds; (3) different system libraries (libmath). From Glatard et al., Fontiers
in Neuroinformatics 2015. Numerical noise creeps up in pipeline analysis.
P. Bellec Mining brain networks Montr´eal 2016 27 / 34
Challenge 2: OS/numerical instability
P. Bellec Mining brain networks Montr´eal 2016 28 / 34
(partial) solution: continuous integration tests
NIAK continuous integration tests running on
https://circleci.com/gh/SIMEXP/niak
P. Bellec Mining brain networks Montr´eal 2016 29 / 34
(partial) solution: continuous integration tests
Each change in NIAK triggers a comparison between current results and a
fixed, target version, across all available pipelines. Quantitative reports
show which stage of the pipeline has changed, and by how much.
P. Bellec Mining brain networks Montr´eal 2016 30 / 34
Future solution: large-scale validation at release
Future NIAK releases will systematically replicate a number of key
large-scale validation experiments and compare results across versions.
This will be made possible by the docker container technology.
Between-group comparisons in resting-state connectivity across three
populations. See Bellec et al., Orban, Neuroimage 2015.
P. Bellec Mining brain networks Montr´eal 2016 31 / 34
Conclusions
The NIAK:
◮ A catalogue of complete workflows. Preprocessing is mature, other
pipelines to follow. CBRAIN interface is beta, feedback welcome.
◮ Scales for large datasets / analyses. Latest version of NIAK is able to
handle smoothly HCP sample.
◮ Incorporates robust, valid methods. Quality control guidelines,
continuous tests, large-scale validation tests.
◮ Free and open-source (MIT).
Recent progresses:
◮ Pipeline research dashboard for fMRI preprocessing. More to come.
◮ PSOM 2 scales better than PSOM 1.
◮ Generic, efficient integration in CBRAIN.
P. Bellec Mining brain networks Montr´eal 2016 32 / 34
Perspectives
◮ More stable methods.
◮ Large-scale tests for each release.
◮ NIAK course in 02/2017.
◮ Looking for beta testers for NIAK@CBRAIN.
◮ Get in touch for feature requests on the preprocessing pipeline.
P. Bellec Mining brain networks Montr´eal 2016 33 / 34
Acknowledgements
◮ Funding: Brain Canada CBRAIN, UdM, UNF/CRIUGM, CCNA (CIHR),
Courtois foundation, Lemaire foundation.
◮ Computing: Compute Canada, Guillimin supercomputer, UNF servers.
◮ NIAK@CBRAIN: Pierre-Olivier Quirion, Tristan Glatard, Sebastien
Lavoie-Courchesne.
◮ QC@NIAK: Yassine Benhajali, Sebastian Urchs, AmanPreet Badhwar,
Perrine Ferr´e, Angela Tam, Christian Dansereau.
◮ validation@NIAK: Pierre Orban, Yassine Benhajali, Felix Carbonell,
Christian Dansereau, Genevi`eve Albouy, Maxime Pelland, Cameron
Craddock, Olivier Collignon, Julien Doyon, Emmanuel Stip.
◮ NIAK: Pierre-Olivier Quirion, Angela Tam, Sebastian Urchs, Yassine
Benhajali, Christian Dansereau, Felix Carbonell, Jussi Tohka. Many indirect
contributions
◮ CBRAIN: Alan Evans, Marc-Etienne Rousseau, Pierre Rioux, Reza Adalat,
and the CBRAIN team.
P. Bellec Mining brain networks Montr´eal 2016 34 / 34

Bic bellec 2016_small

  • 1.
    Neuroimaging Analysis Kit- Progress and challenges for standardized fMRI processing Pierre Bellec pierre.bellec@criugm.qc.ca Feindel Brain Imaging Lecture - BIC/MNI/McGill 2016/10 P. Bellec Mining brain networks Montr´eal 2016 1 / 34
  • 2.
    What’s NIAK The NeuroimagingAnalysis Kit (NIAK): a software package for data mining of brain networks in large fMRI datasets. ◮ A catalogue of complete workflows. ◮ Scales for large datasets / analyses. ◮ Incorporates robust, valid methods. ◮ Free and open-source (MIT). P. Bellec Mining brain networks Montr´eal 2016 2 / 34
  • 3.
    Available pipelines Check http://niak.simexp-lab.orgfor more info. P. Bellec Mining brain networks Montr´eal 2016 3 / 34
  • 4.
    fMRI preprocessing: flowchart P.Bellec Mining brain networks Montr´eal 2016 4 / 34
  • 5.
    Structural non-linear coregistration P.Bellec Mining brain networks Montr´eal 2016 5 / 34
  • 6.
    Structural processing: mainoutputs raw T1 volume non-uniformity corrected volume brain mask linear MNI152 template non-linear MNI152 template linear (lsq9) coregistered volume non-linear coregistered volume The main outputs of the T1 (CIVET) processing pipeline. P. Bellec Mining brain networks Montr´eal 2016 6 / 34
  • 7.
    T1 to BOLDimage registrationCorrecttozeromean,smooth,eresample Correcttozeromean,smooth iteration 1 : large smoothing iteration 5 : small smoothing 5 iterations progressive fit : LSQ6 coregistration - MINCTRACC (mutual information) iteration 1 : large smoothing iteration 5 : small smoothing T1 volume & brain mask fMRI volume & brain mask smooth : 8,4,8,4,3 step : 4,4,4,2,1 simplex : 8,4,2,2,1 smooth : 8,4,8,4,3 step : 4,4,4,2,1 simplex : 8,4,2,2,1 P. Bellec Mining brain networks Montr´eal 2016 7 / 34
  • 8.
    Estimation of rigid-bodymotion over time within-run motion parameters : 3 rotations 3 translations for each volume volume of reference (median) time time P. Bellec Mining brain networks Montr´eal 2016 8 / 34
  • 9.
    Scrubbing: frame displacement Framedisplacement is the sum of absolute displacements in translation and rotation motion parameters. Frames with excessive FD (FD> 0.5) and neighbours are eliminated (Power et al. Neuroimage 2012). P. Bellec Mining brain networks Montr´eal 2016 9 / 34
  • 10.
    Regression of confounds P.Bellec Mining brain networks Montr´eal 2016 10 / 34
  • 11.
    How does itwork? Main use case is based on Matlab/Octave. Tutorial available at http:// niak.simexp-lab.org/niak_tutorial_fmri_preprocessing.html, also as a jupyter notebook. P. Bellec Mining brain networks Montr´eal 2016 11 / 34
  • 12.
    fMRI preprocessing: update Notablefeatures in upcoming NIAK “COG” release ◮ Dual support for MINC and NIFTI file formats. ◮ Minimally preprocessed data: resampled data is available along with all available confounds, for further analysis in SPM, FSL, etc. ◮ Interactive fMRI preprocessing report. ◮ Simplified guidelines for quality control P. Bellec Mining brain networks Montr´eal 2016 12 / 34
  • 13.
    Interactive report Reports canbe consulted offline or online. Live demo at https://simexp.github.io/qc_cobre/. P. Bellec Mining brain networks Montr´eal 2016 13 / 34
  • 14.
    Guidelines for qualitycontrol of brain registration Simplified guildelines for quality control as well as a collection of images to rate are available on zooniverse https://www.zooniverse.org/ projects/simexp/brain-mri-registration-quality-control P. Bellec Mining brain networks Montr´eal 2016 14 / 34
  • 15.
    One pipeline, manyjobs... Jobs and dependencies for fMRI preprocessing of two subjects with two functional runs each. P. Bellec Mining brain networks Montr´eal 2016 15 / 34
  • 16.
    The pipeline systemfor Octave and Matlab NIAK is powered by PSOM, an open-source library for scripting pipelines using Octave or Matlab (Bellec et al., Frontiers in Neuroinformatics, 2012). ◮ Parallel computing: Detection and execution of parallel components in the pipeline. The same code can run in a variety of execution environments (local, multi-core, cluster). ◮ Provenance tracking: Generation of a comprehensive record of the pipeline stages and the history of execution. ◮ Fault tolerance: Multiple attempts will be made to run each job before it is considered as failed. Failed jobs can be automatically re-started. ◮ Smart updates: When an analysis is started multiple times, only the parts of the pipeline that need to be reprocessed are executed. http://psom.simexp-lab.org P. Bellec Mining brain networks Montr´eal 2016 16 / 34
  • 17.
    PSOM 1.0 PSOM 1.0follows a basic submission design, where each available job gets submitted for execution, with a maximum of N concurrent processes. Running J jobs requires J submissions, regardless of N. Works inefficiently for large J and short jobs in systems with large overhead for submission. P. Bellec Mining brain networks Montr´eal 2016 17 / 34
  • 18.
    Benchmark PSOM 1.0 Adaptedfrom Bellec et al. Front. in NeuroInf. 2012. ◮ Dataset Cambridge, 198 subjects with T1/fMRI. ◮ 5153 jobs / 7.7 G raw input / 21 G output / 8348 unique input/output files. ◮ peuplier: single machine (i7, 4 cores / 8 threads), local file system. ◮ magma: single machine (AMD, 24 cores), NFS file system. ◮ guillimin: supercomputer (Xeon, 14k cores on 2011), infiniband parallel file system. ◮ Efficiency went down from 90% on peuplier-8 to 60% on guillimin-200. P. Bellec Mining brain networks Montr´eal 2016 18 / 34
  • 19.
    PSOM 2.0 PSOM 2.0,currently in beta, features an agent-based execution model. Running N parallel processes requires N + 1 submissions, regardless of number of jobs J. Works efficiently in systems with large overhead for submission, regardless of J and job duration (1s+). P. Bellec Mining brain networks Montr´eal 2016 19 / 34
  • 20.
    Benchmark PSOM 2.0 ◮Dataset Human Connectome Project, 875 subjects with T1 + 7 mutliband fMRI task runs. ◮ 123k jobs / 3.4 T raw input / 3.8 T output / 173k unique input/output files. ◮ guillimin: supercomputer (Xeon, 20k+ cores on 2016), infiniband parallel file system. ◮ Up to 300 concurrent processes allowed. ◮ Serial time: 17.9k hours / 746.87 days. Parallel time: 70 hrs. Parallelization efficiency: 85% ◮ deviation from 100% efficiency mostly attributable to queuing delays in order to access resources. P. Bellec Mining brain networks Montr´eal 2016 20 / 34
  • 21.
    Integration with CBRAIN- frontend The NIAK fMRI preprocessing pipeline, and soon the whole NIAK pipeline catalogue, are integrated in CBRAIN. P. Bellec Mining brain networks Montr´eal 2016 21 / 34
  • 22.
    NIAK deployment usingDocker ◮ The NIAK now ships as a docker container, available in docker hub https://hub.docker.com/, as well as singularity http://singularity.lbl.gov/, designed for high-performance computing infrastructures. ◮ The container includes all dependencies (MINC-toolkit, Octave, PSOM, NIAK, Brain Connectivity Toolbox, Jupyter). ◮ This facilitates installation on all platforms, CBRAIN, Linux, Mac, Windows http://niak.simexp-lab.org/niak_installation.html P. Bellec Mining brain networks Montr´eal 2016 22 / 34
  • 23.
    Integration with CBRAIN- backend Lavoie-Courchesne et al., Journal of Physics: Conference Series 2011; Glatard et al., HBM 2016; Glatard et al., submitted to Future Generation Computer Systems P. Bellec Mining brain networks Montr´eal 2016 23 / 34
  • 24.
    Integration with CBRAIN- BIDS support Datasets fed into niak need to be organized using the Brain Imaging Data Structure (BIDS) http://bids.neuroimaging.io/. Proper organization can be validated on the CBRAIN portal. Gorgolewski et al., Scientific Data 2016 P. Bellec Mining brain networks Montr´eal 2016 24 / 34
  • 25.
    Challenge: pipeline development Asoftware package is a living organism. Courtesy of Sam and Max. Developping scientific workflows is like signing for a game of whack a mole (Courtesy of Alan Evans). P. Bellec Mining brain networks Montr´eal 2016 25 / 34
  • 26.
    Challenge: pipeline development Aworked example: Courtesy of Sam and Max. ◮ Increase image resolution. GOOD. ◮ Better inter-subject brain alignment. GOOD. ◮ Thus, less spatial blurring is needed. GOOD. ◮ Hence, random field theory breaks down. FAIL. P. Bellec Mining brain networks Montr´eal 2016 26 / 34
  • 27.
    Challenge 2: OS/numericalinstability DICE coefficient between matched components from an ICA decomposition across two runs executed on the same system. (1) automatic detection of the number of components; (2) same random seeds; (3) different system libraries (libmath). From Glatard et al., Fontiers in Neuroinformatics 2015. Numerical noise creeps up in pipeline analysis. P. Bellec Mining brain networks Montr´eal 2016 27 / 34
  • 28.
    Challenge 2: OS/numericalinstability P. Bellec Mining brain networks Montr´eal 2016 28 / 34
  • 29.
    (partial) solution: continuousintegration tests NIAK continuous integration tests running on https://circleci.com/gh/SIMEXP/niak P. Bellec Mining brain networks Montr´eal 2016 29 / 34
  • 30.
    (partial) solution: continuousintegration tests Each change in NIAK triggers a comparison between current results and a fixed, target version, across all available pipelines. Quantitative reports show which stage of the pipeline has changed, and by how much. P. Bellec Mining brain networks Montr´eal 2016 30 / 34
  • 31.
    Future solution: large-scalevalidation at release Future NIAK releases will systematically replicate a number of key large-scale validation experiments and compare results across versions. This will be made possible by the docker container technology. Between-group comparisons in resting-state connectivity across three populations. See Bellec et al., Orban, Neuroimage 2015. P. Bellec Mining brain networks Montr´eal 2016 31 / 34
  • 32.
    Conclusions The NIAK: ◮ Acatalogue of complete workflows. Preprocessing is mature, other pipelines to follow. CBRAIN interface is beta, feedback welcome. ◮ Scales for large datasets / analyses. Latest version of NIAK is able to handle smoothly HCP sample. ◮ Incorporates robust, valid methods. Quality control guidelines, continuous tests, large-scale validation tests. ◮ Free and open-source (MIT). Recent progresses: ◮ Pipeline research dashboard for fMRI preprocessing. More to come. ◮ PSOM 2 scales better than PSOM 1. ◮ Generic, efficient integration in CBRAIN. P. Bellec Mining brain networks Montr´eal 2016 32 / 34
  • 33.
    Perspectives ◮ More stablemethods. ◮ Large-scale tests for each release. ◮ NIAK course in 02/2017. ◮ Looking for beta testers for NIAK@CBRAIN. ◮ Get in touch for feature requests on the preprocessing pipeline. P. Bellec Mining brain networks Montr´eal 2016 33 / 34
  • 34.
    Acknowledgements ◮ Funding: BrainCanada CBRAIN, UdM, UNF/CRIUGM, CCNA (CIHR), Courtois foundation, Lemaire foundation. ◮ Computing: Compute Canada, Guillimin supercomputer, UNF servers. ◮ NIAK@CBRAIN: Pierre-Olivier Quirion, Tristan Glatard, Sebastien Lavoie-Courchesne. ◮ QC@NIAK: Yassine Benhajali, Sebastian Urchs, AmanPreet Badhwar, Perrine Ferr´e, Angela Tam, Christian Dansereau. ◮ validation@NIAK: Pierre Orban, Yassine Benhajali, Felix Carbonell, Christian Dansereau, Genevi`eve Albouy, Maxime Pelland, Cameron Craddock, Olivier Collignon, Julien Doyon, Emmanuel Stip. ◮ NIAK: Pierre-Olivier Quirion, Angela Tam, Sebastian Urchs, Yassine Benhajali, Christian Dansereau, Felix Carbonell, Jussi Tohka. Many indirect contributions ◮ CBRAIN: Alan Evans, Marc-Etienne Rousseau, Pierre Rioux, Reza Adalat, and the CBRAIN team. P. Bellec Mining brain networks Montr´eal 2016 34 / 34