-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.html
185 lines (183 loc) · 7.47 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html []>
<html>
<head>
<meta charset="UTF-8" />
<meta name="author" content="MarkdownViewer++" />
<title>README.md</title>
<style type="text/css">
/* Avoid page breaks inside the most common attributes, especially for exports (i.e. PDF) */
td, h1, h2, h3, h4, h5, p, ul, ol, li {
page-break-inside: avoid;
}
</style>
</head>
<body>
<h1 id="software-for-astrocyte-analysis">Software for astrocyte analysis</h1>
<h2 id="introduction">Introduction</h2>
<p>Implementation of a new method for astrocyte analysis. Method is based
on "sliding" window approach and include the following stages:</p>
<ol>
<li>
<p>
<strong>Video preprocessing</strong>:</p>
<ul>
<li>Aligning an image (eliminating jitter).</li>
<li>Calculating noise parameters and subtracting the camera noise.</li>
<li>Filtering video frames <a href="http://www.cs.tut.fi/%7Efoi/GCF-BM3D">BM3D</a>.</li>
<li>Evaluating a noise level on the filtered video.</li>
</ul>
</li>
<li>
<p>
<strong>Calculating a baseline</strong> of the fluorescence intensity and its relative variation based on the noise information.</p>
</li>
<li>
<p>
<strong>Detecting calcium events</strong> based on the relative intensity variation.</p>
</li>
</ol>
<h2 id="project-structure">Project structure</h2>
<p>Project consists of the following directories:</p>
<ol>
<li>
<p>
<code>3rd_party</code> - third-party libraries is used in the project:</p>
<ul>
<li>
<code>dbscan</code> - DBScan implementation (not needed now, because faster implementation is used).</li>
<li>
<code>gtest</code> - Google Testing Framework.</li>
<li>
<code>bm3d</code> - BM3D implementation (follow steps in <code>3rd_party/bm3d/README</code> to get implementation).</li>
<li>
<code>DataHash</code> - data hashing for internal use.</li>
<li>
<code>plot_mk</code> - library for prettifying MATLAB plot.</li>
<li>
<code>progress_bar</code> - GUI progress bar library.</li>
<li>
<code>tabplot</code> - GUI tabs library.</li>
</ul>
</li>
<li>
<p>
<code>astrocytes_library</code> - C++ library for astrocyte analysis.</p>
</li>
<li>
<p>
<code>auxiliary_scripts</code> - auxiliary scripts to analyze temporary data.</p>
</li>
<li>
<p>
<code>matlab_scripts</code> - matlab-scripts for researchers.</p>
</li>
<li>
<p>
<code>data</code> - directory with short test sample (<code>*z-max*.mat</code> - maximal projection),
three-dimensional matrix <code>width*height*k</code>, where <code>width</code> is a frame width, <code>height</code>
is a frame height, <code>k</code> is a number of frames.</p>
</li>
<li>
<p>
<code>mex_wrappers</code> - mex-functions (wrappers) for the library
of astrocyte analysis.</p>
</li>
<li>
<p>
<code>tests</code> - automatic tests to check correctness of the algorithm.</p>
</li>
</ol>
<h2 id="prerequisites">Prerequisites</h2>
<p>Software for astrocyte analysis has several dependencies:</p>
<ol>
<li>MATLAB is required to read/write mat-files (version >= R2016a).</li>
<li>Boost (version >= 1.60),
<a href="https://sourceforge.net/projects/boost/files/boost-binaries">binaries for Windows</a>.</li>
<li>
<a href="http://opencv.org">OpenCV</a> (version 2.4.*).</li>
<li>
<a href="http://www.cs.tut.fi/%7Efoi/GCF-BM3D/BM3D.zip">BM3D</a> is required for filtering frames (follow steps described
in <code>3rd_party/bm3d/README</code>).</li>
</ol>
<p>Environment:</p>
<ol>
<li>Windows
<ul><li><a href="https://cmake.org/download">CMake</a> (version >=3.1.0).</li><li>C++ Compiler (for example, Visual C++ Compiler from Microsoft Visual Studio 2013,
2015 is preferable).</li></ul></li>
<li>Linux
<ul><li><a href="https://cmake.org/download">CMake</a> (version >=3.1.0).</li><li>C++ Compiler (for example, GCC >= 4.7).</li></ul></li>
</ol>
<h2 id="how-to-build">How to build</h2>
<h3 id="windows-visual-c-compiler">Windows (Visual C++ Compiler)</h3>
<ol>
<li>
<p>Install prerequisites.</p>
</li>
<li>
<p>Download <a href="https://github.com/UNN-VMK-Software/astro-events-analysis">source code</a>.</p>
</li>
<li>
<p>Open Command Prompt Window (use <a href="http://windows.microsoft.com/en-us/windows-vista/open-a-command-prompt-window">this</a> manual).</p>
</li>
<li>
<p>Create build directory <code>astro-events-analysis-build</code> next
to the directory <code>astro-events-analysis</code> using the following
command:</p>
<pre>
<code class="language-bash">mkdir astro-events-analysis-build
</code>
</pre>
</li>
<li>
<p>Set <code>astro-events-analysis-build</code> as current directory using the following
command:</p>
<pre>
<code class="language-bash">cd astro-events-analysis-build
</code>
</pre>
</li>
<li>
<p>Generate Visual Studio solution to compile sources using the following
command. Note: if Boost library installed from binaries you must
set <code>BOOST_ROOT</code>, <code>Boost_INCLUDE_DIRS</code> and <code>Boost_LIBRARY_DIR</code>.</p>
<pre>
<code class="language-bash">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
</code>
</pre>
<p>Example:</p>
<pre>
<code class="language-bash">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
</code>
</pre>
</li>
<li>
<p>Choose Release and x64 modes in main menu of Visual Studio.</p>
</li>
<li>
<p>Choose project <code>ALL_BUILD</code> and execute command <code>Rebuild</code> in the menu that you get
after right mouse click. You will see static libraries <code>astrocytes_analysis.lib</code>,<code>dbscan.lib</code>,
3 mex-wrappers (<code>preprocessing.mexw64</code>, <code>background_subtraction.mexw64</code>, <code>find_events.mexw64</code>),
and binary file <code>test_astrocytes_analysis.exe</code> (contains some automatic tests for developers)
in the directory <code>astro-events-analysis-build\bin</code>.</p>
</li>
</ol>
<h2 id="how-to-run">How to run</h2>
<p>Detailed user's guide located in <code>matlab_scripts/README</code>.</p>
<!-- LINKS -->
</body>
</html>