Select Page

Building BDP

Building BDP

The source code for BDP is available on the download page. Except where otherwise noted, the source code is provided under a GPL v2 license.

System/Compiler Requirements

C++ compiler

We have built the official releases using the following compilers on the following platforms:

We recommend using these compilers to ensure cross-platform consistency.

Matlab R2015b

BDP is currently written in a mainly in Matlab. In order to compile SVReg Matlab code into an executable, we need Image Processing Toolbox and Compiler Toolbox. The Parallel computing toolbox is recommended.

To compile BDP, open Matlab and navigate to the src\packaging_tools folder of the repository. The two main functions that you’d need are:
CompileBDPMexFiles.m: compiles mex functions.
CompileBrainSuiteDiffusionPipeline.m: compiles Matlab code and generates executables.

Source Tree

Unzip the source file Within this folder are the following subfolders:

  • BDP_statistics The source codes for statistics computation.
  • data_handling_tools Codes for data input and outputs.
  • diffusion_tools Source codes implementing algorithms for diffusion imaging.
  • helper_tools Source codes for general utilities.
  • 3rdParty Third party libraries used by BDP
  • image_registration_tools Source codes for image registration tools in BDP
  • main_functions Main wrapper source code for BDP
  • mat_files Mat files read by BDP at runtime
  • optimization Source codes for optimization methods used by BDP
  • operators Source codes for generating matrices for operators used by BDP
  • visualization_tools Scripts for visualization of outputs by BDP


It will compile all required mex functions. Note that you should change the
generated Makefile in Linux and Mac to use clang instead of gcc.


The MATLAB code for BDP can be compiled to generate packages by running following:

CompileBrainSuiteDiffusionPipeline --package 99aRC9 --build 9999

where, `99aRC9` is the name of release and `9999` is four digit build number. This will generate relevant tarball/zip for distribution. Note that above step requires `mcc` command from MATLAB Compiler toolbox.