Implementation of a new method for astrocyte analysis. Method is based on "sliding" window approach and include the following stages:
-
Video preprocessing:
- Aligning an image (eliminating jitter).
- Calculating noise parameters and subtracting the camera noise.
- Filtering video frames BM3D.
- Evaluating a noise level on the filtered video.
-
Calculating a baseline of the fluorescence intensity and its relative variation based on the noise information.
-
Detecting calcium events based on the relative intensity variation.
Project consists of the following directories:
-
3rd_party
- third-party libraries is used in the project:dbscan
- DBScan implementation (not needed now, because faster implementation is used).gtest
- Google Testing Framework.bm3d
- BM3D implementation (follow steps in3rd_party/bm3d/README
to get implementation).DataHash
- data hashing for internal use.plot_mk
- library for prettifying MATLAB plot.progress_bar
- GUI progress bar library.tabplot
- GUI tabs library.
-
astrocytes_library
- C++ library for astrocyte analysis. -
auxiliary_scripts
- auxiliary scripts to analyze temporary data. -
matlab_scripts
- matlab-scripts for researchers. -
data
- directory with short test sample (*z-max*.mat
- maximal projection), three-dimensional matrixwidth*height*k
, wherewidth
is a frame width,height
is a frame height,k
is a number of frames. -
mex_wrappers
- mex-functions (wrappers) for the library of astrocyte analysis. -
tests
- automatic tests to check correctness of the algorithm.
Software for astrocyte analysis has several dependencies:
- MATLAB is required to read/write mat-files (version >= R2016a).
- Boost (version >= 1.60), binaries for Windows.
- OpenCV (version 2.4.*).
- BM3D is required for filtering frames (follow steps described
in
3rd_party/bm3d/README
).
Environment:
- Windows
- CMake (version >=3.1.0).
- C++ Compiler (for example, Visual C++ Compiler from Microsoft Visual Studio 2013, 2015 is preferable).
- Linux
- CMake (version >=3.1.0).
- C++ Compiler (for example, GCC >= 4.7).
-
Install prerequisites.
-
Download source code.
-
Open Command Prompt Window (use this manual).
-
Create build directory
astro-events-analysis-build
next to the directoryastro-events-analysis
using the following command:mkdir astro-events-analysis-build
-
Set
astro-events-analysis-build
as current directory using the following command:cd astro-events-analysis-build
-
Generate Visual Studio solution to compile sources using the following command. Note: if Boost library installed from binaries you must set
BOOST_ROOT
,Boost_INCLUDE_DIRS
andBoost_LIBRARY_DIR
.cmake -G <Generator-name> -DOpenCV_DIR=<OpenCVConfig.cmake-directory> [-DBOOST_ROOT=<Boost-library-directory>] [-DBoost_INCLUDE_DIRS=<dir-with-boost-header-files>] [-DBoost_LIBRARY_DIR=<dir-with-boost-lib-files>] [-DMATLAB_ROOT=<matlab-dir>] -DMatlab_MX_LIBRARY="<dir-with-libmx>\libmx.lib" -DMatlab_ENG_LIBRARY="<dir-with-libeng>\libeng.lib" ..\astro-events-analysis
Example:
cmake -G "Visual Studio 14 2015 Win64" -DOpenCV_DIR="c:\Program Files\opencv2411\vs2015" -DBOOST_ROOT="c:\boost_1_60_0" -DBoost_INCLUDE_DIRS="c:\boost_1_60_0\boost" -DBoost_LIBRARY_DIR="c:\boost_1_60_0\lib64-msvc-14.0" -DMATLAB_ROOT="c:\Program Files\MATLAB\R2010a" -DMatlab_MX_LIBRARY="c:\Program Files\MATLAB\R2010a\extern\lib\win64\microsoft\libmx.lib" -DMatlab_ENG_LIBRARY="c:\Program Files\MATLAB\R2010a\extern\lib\win64\microsoft\libeng.lib" ..\astro-events-analysis
-
Choose Release and x64 modes in main menu of Visual Studio.
-
Choose project
ALL_BUILD
and execute commandRebuild
in the menu that you get after right mouse click. You will see static librariesastrocytes_analysis.lib
,dbscan.lib
, 3 mex-wrappers (preprocessing.mexw64
,background_subtraction.mexw64
,find_events.mexw64
), and binary filetest_astrocytes_analysis.exe
(contains some automatic tests for developers) in the directoryastro-events-analysis-build\bin
.
Detailed user's guide located in matlab_scripts/README
.