Download and Installation

BacStalk is written in Matlab 2017b.

There are two versions of BacStalk available.

  • If you don’t have Matlab, you can use a standalone pre-compiled version which requires Matlab runtime R2017b. This version lacks the Matlab figure editor to modify figures created with BacStalk.

  • If you have Matlab (later version than 2014b) available, we recommend you downloading the source code and simply running the included file BacStalk.m.





Operation System



2 Mb


Requires Matlab R2014b or later with the Image Processing Toolbox (required) and Parallel Computing Toolbox (optional). Version 1.45 supports Matlab 2018b now!



100 Mb


Setup will download and install Matlab runtime R2017b



100 Mb


Setup will download and install Matlab runtime R2017b (If you receive an error during installation, please use the fix described here.)


94 Mb

Mac OS

Setup will download and install Matlab runtime R2017b


Installation of the stand-alone version

  • Windows: Install BacStalk_standalone_win.exe and open BacStalk.exe.

Running BacStalk inside Matlab

  1. Extract

  2. Open Matlab.

  3. In Matlab change the current path to the folder BacStalk was extracted into.

  4. Type the following command to launch BacStalk:


Test data sets

  • Test dataset 1: Phase contrast images of Caulobacter crescentus cells grown in the presence (_P_) and absence (_noP_) of phosphate. In the absence of phosphate, stalks become elongated. This test data set can be used to test the stalk detection algorithm.

  • Test dataset 2: Timelapse of Hyphomonas neptunium strain shown in Fig. 4C of the paper, featuring phase contrast images, as well as images in two fluorescent channels. This test data set can be used to test options that become available on timelapse data, such as kymographs, as well as fluorescence features.

  • Test dataset 3: Images of Myxococcus xanthus in phasecontrast and fluorescence. The test set can be used to see how well non-stalked cells are detected and which challenges arise when the cell density is too high.