An automatic cell detection and tracking method that works well even on low quality images (obscured cells, blurred frames, etc) and different types of cells and microscopic imaging techniques.
Requires to train the models using dot-annotations (for detection module) and link-annotations (for tracking module).
In the command prompt/terminal:
> git clone https://github.com/pedrokost/cell_detector_and_tracker.git
> cd cell_detector_and_tracker/+detector/setup
# Make the setup script executable
> chmod +x setup.sh
# Execute the script... (it may take awhile)
> ./setup.sh
Then, run MATLAB, and execute the following
cd ~/src/PylonCode % Location of Pylon and QPBO dependencies
pylonSetup % Will generate the mex files
When compiling the SVM_struct_matlab
code, you might get a warning like this:
Warning: You are using gcc version '4.8.2'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'.
In this case Google for a solution. It should be as simple as downloading gcc 4.7:
sudo apt-get install gcc-4.7 g++-4.7
Remember to execute the setup script again after the correct version of gcc is set.
First, in dataFolders.m
configure the image directories. Simply, add a block of code like this at the bottom of the switch
statement:
case 20 % dataset ID: augment previous integer by 1
% This is the directory with the dot annotated images
dotFolder = fullfile('..', 'data', 'sample');
% This will be the output directory, where the results are saved
outFolder = fullfile('..', 'dataout', 'sample');
% This is the directory with the link annotated images
% (can *sometimes* be equal to dotFolder)
linkFolder = fullfile('..', 'data', 'sample');
% The number of manually annotated frames (dot annotation)
numAnnotatedFrames = 50;
% The number of annotated trajectories (link annotations)
numAnnotatedTrajectories = 5;
Second, in runner.m
set and configure the following variables:
datasetIDs = [20]; % The dataset ID as set in dataFolders.m
% Training the detector and tracker
trainDetector = true;
trainTracker = true;
% Evaluating a trained detector and tracker
testDetector = true;
testTracker = true;
showTracks = true; % Display a plot of the tracks
Finally, run runner.m
.
Please refere to the TODO file for a list of possible improvements.
Good pull requests—patches, improvements, new features—are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
This project relies on the following libraries:
- VL_feat
- SVM_struct_matlab
- Inference code for Pylon models, which depends on the QPBO from Vladimir Kolmogorov.
These dependencies can be downloaded and installed using an automated script, as described above, in the Setup instructions.
The projects was developed and tested on MATLAB R2014a on Ubuntu 14.04, but I think it should work fine on R2013b as well. It won't work on versions prior or equal to R2013a, because of changes in the Neural Network Toolbox.
The original code from the cell detector module was developed by C. Arteta, V. Lempitsky, J. A. Noble and A. Zisserman. Although some performance and structural improvements were required to use their code for this project, their code was of great help.