Skip to content
BIDS App containing an instance of the SPM software.
MATLAB Dockerfile Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
circle.yml Matching BIDS-Apps/example Oct 17, 2016
pipeline_participant.m Example configuration file for group level now computes mean structur… Jan 10, 2018
spm_BIDS_App.m Bug fix for participants* file. Jan 17, 2018



BIDS App containing an instance of the SPM12 software.


Extensive documentation can be found in the SPM manual.


To launch an instance of the container and analyse some data in BIDS format, type:

$ docker run bids/spm bids_dir output_dir level [--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]] [--config CFG_FILE]

For example, to run an analysis in participant level mode, type:

$ docker run -ti --rm \
  -v /tmp:/tmp \
  -v /var/tmp:/var/tmp \
  -v /path/to/local/bids/input/dataset/:/data \
  -v /path/to/local/output/:/output \
  bids/spm \
  /data /output participant --participant_label 01

For example, to run an analysis in group level mode with a user-defined pipeline, type:

$ docker run -ti --rm \
  -v /tmp:/tmp \
  -v /var/tmp:/var/tmp \
  -v /path/to/local/bids/input/dataset/:/data \
  -v /path/to/local/output/:/output \
  -v /path/to/local/cfg/:/cfg \
  bids/spm \
  /data /output group --config /cfg/my_pipeline_group.m

To build the container, type:

$ docker build -t <yourhandle>/spm12 .

Configuration file

The configuration file is a MATLAB script detailing the analysis pipeline to be executed. Two struct variables, BIDS and BIDS_App are available from within the script, containing details from the command line and the BIDS-formatted dataset. In particular, the BIDS structure can be queried using the spm_BIDS() function. The default configuration files for first and second level analyses are pipeline_participant.m and pipeline_group.m. A template for a single configuration file for all levels could be as follow:

if strcmp(BIDS_App.level,'participant')
    % First level analysis
    % Get T1-weighted image filename for given subject:
    % a = spm_BIDS(BIDS,'data', 'modality','anat', 'type','T1w');
    % ...
    % Second level analysis
    % The name of the directory containing first level outputs is stored in:
    % BIDS_App.outdir
    % ...

Error Reporting

If you have a specific problem with the SPM BIDS App, please open an issue on GitHub.

If your issue concerns SPM more generally, please use the SPM mailing list.


Please refer to:

  editor = {K.J. Friston and J. Ashburner and S.J. Kiebel and T.E. Nichols and W.D. Penny},
  title = {Statistical Parametric Mapping: The Analysis of Functional Brain Images},
  publisher = {Academic Press},
  year = {2007},
  url = {} 
You can’t perform that action at this time.