-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcalculations.html
More file actions
150 lines (139 loc) · 11.2 KB
/
calculations.html
File metadata and controls
150 lines (139 loc) · 11.2 KB
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
<!DOCTYPE html>
<html>
<head>
<title>User manual</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" href="imgs/logo.png">
</head>
<body>
<header class="w3-container w3-center w3-padding-32">
<div class="row">
<div class="column">
<img src="imgs/logo.png" style="width:8%">
</div>
<div class="column">
<h1><b>USER MANUAL</b></h1>
<p>Welcome to the user manual for the <span class="w3-tag">BrainMapper</span> software.</p>
</div>
</div>
</header>
<div class="row">
<div class="column-left">
<div class="w3-card w3-margin w3-margin-top">
<div id="toc_container">
<p class="toc_title">Contents - Calculation</p>
<a href="index.html" style="color : #5577ee"> Go back to home page </a>
<ul class="toc_list">
<li><a href="#41"><strong>4.1. Data extracted for calculation</strong></a></li>
<ul>
<li><a href="#411">4.1.1. How data is extracted</a></li>
</ul>
<li><a href="#42"><strong>4.2. Optimization of calculations</strong></a></li>
<ul>
<li><a href="#421">4.2.1. Adapted library</a></li>
<li><a href="#422">4.2.2. Reduction of search space in data extraction</a></li>
</ul>
<li><a href="#43"><strong>4.3. List of implemented calcul</strong></a></li>
<ul>
<li><a href="#431">4.3.1. Addition</a></li>
<li><a href="#432">4.3.2. Boolean Intersection</a></li>
<li><a href="#433">4.3.3. Boolean Union</a></li>
<li><a href="#434">4.3.4. Centroid</a></li>
<li><a href="#435">4.3.5. Closing</a></li>
<li><a href="#436">4.3.6. Dilatation</a></li>
<li><a href="#437">4.3.7. Entropy</a></li>
<li><a href="#438">4.3.8. Erosion</a></li>
<li><a href="#439">4.3.9. Mean</a></li>
<li><a href="#4310">4.3.10. Normalization</a></li>
<li><a href="#4311">4.3.11. Opening</a></li>
<li><a href="#4312">4.3.12. Threshold</a></li>
</ul>
<li><a href="#script_env"><strong>4.4. Procedure to apply a calculation</strong></a></li>
<li><a href="#441">4.4.1. Load and select a set of nifti collection</a></li>
<li><a href="#442">4.4.2. Select a calculation and the parameters</a></li>
<li><a href="#443">4.4.3. Execute the algorithm and save it in the calculation tab</a></li>
<li><a href="#444">4.4.4. Have an overview of the results in the Edit view</a></li>
</ul>
</div>
</div>
</div>
<div class="column-right">
<div id="Calculations">
<h1> Perform calculations on NIfTI data</h1>
<p>
One of the fundamental points of this project is to be able to apply several calculations and operations on one or a set of nifti files. These operations can aim to establish statistics between different files (Average, linear combinations), or to cross information between different files (Intersection, union), to extract information more easily in a file (calculation centers of gravity or entropy) or to apply transformations on a file to improve the quality of the data and to suppress the noise for example (Mathematical Morphologies)
</p>
<h2 id="41">4.1. Data extracted for calculation</h2>
<h3 id="411">4.1.1. How data is extracted</h3>
<p>The data contained in the nifti files are extracted using the NiBabel library which retrieves the 3D matrix do voxels. Then we store in a table all the voxels whose intensity is strictly positive. We thus succeed in reducing all the voxels considered. This table is a numpy.array of dimension 4 (x, y, z, i) where x, y, z are the coordinates of the voxels in the matrix and i the intensity of the voxel</p>
<h2 id="42">4.2. Optimization of calculations</h2>
<h3 id="421">4.2.1. Adapted library</h3>
<p>To optimize the speed of computation, we use the numpy library which makes it possible to reduce by a ratio 100 the execution time of the calculations thanks to a parralelization procedure which makes it possible to distribute the computations to each processor of the computer in question.</p>
<h3 id="422">4.2.2. Reduction of search space in data extraction</h3>
<p>To further improve the results we decrease the search space related to the extraction of positive voxels. To be done instead of running a bare course in the 3 dimensiosn that are x, y and z in the dataset of the Nifti file which would be about 4,000,000 voxels to visit we reduce this to a cube that includes all of them voxels whose intensity is strictly positive. Thus the extraction process becomes much faster. We go from an extraction that lasts more than 2 minutes to an instantaneous extraction of less than half a second</p>
<div style="padding-left: 15%; padding-top: 1%;padding-bottom: 1%;">
<img src="imgs/calculation/optimisationCalcul.png" style="width:50%">
</div>
<h2 id="43">4.3. List of implemented calcul</h2>
<h3 id="431">4.3.1. Addition</h3>
<p>The Addition algorithm make a addition with a collection of nifti makes the term some term of each voxel</p>
<h3 id="432">4.3.2. Boolean Intersection</h3>
<p>The Boolean intersection takes a set of files and returns a binary file of 0 and 1. A voxel with 1 value means that for every file this voxels have strictely positive intensity</p>
<h3 id="433">4.3.3. Boolean Union</h3>
<p>The Boolean union takes a set of files and returns a binary file of 0 and 1. A voxel with 1 value means that there exists in at least some files nifti a voxel whose intensity is strictly positive</p>
<h3 id="434">4.3.4. Centroide</h3>
<p>This algorithm calculates the centroid of each cluster present in one or a set of nifti files</p>
<h3 id="435">4.3.5. Closing</h3>
<p>In mathematical morphology, the closing of a set (binary image) A by a structuring element B is the erosion of the dilation of that set, A * B = ( A (+) B ) (-) B, denote the dilation and erosion, respectively. In image processing, closing is, together with opening, the basic workhorse of morphological noise removal. Opening removes small objects, while closing removes small holes.</p>
<h3 id="436">4.3.6. Dilatation</h3>
<p>Dilation (usually represented by (+)) is one of the basic operations in mathematical morphology. Originally developed for binary images, it has been expanded first to grayscale images, and then to complete lattices. The dilation operation usually uses a structuring element for probing and expanding the shapes contained in the input image.</p>
<h3 id="437">4.3.7. Entropy</h3>
<p>The entropy of an image is a decimal value that allows to characterize the degree of disorganization, or unpredictability of the information content of a system.</p>
<h3 id="438">4.3.8. Erosion</h3>
<p>Erosion (usually represented by (-)) is one of two fundamental operations (the other being dilation) in morphological image processing from which all other morphological operations are based. It was originally defined for binary images, later being extended to grayscale images, and subsequently to complete lattices.</p>
<h3 id="439">4.3.9. Mean</h3>
<p>The Mean process averages a set of nifti files. The algorithm performs the sum for all voxels present in each file the divides the value obtained by the number of files</p>
<h3 id="4310">4.3.10. Normalization</h3>
<p>The normalization algorithm creates one nifti file result for each input nifti file. This algorithm create a file where the values for each voxel are between 0 and 1. Different ways exit to normalize a nifti file, you can select in the options panel the desired method</p>
<h3 id="4311">4.3.11. Opening</h3>
<p>In morphological opening ( A (-) B ) (+) B, erosion operation removes objects that are smaller than structuring element B and dilation operation restores the shape of remaining objects. However, restoring accuracy in dilation operation highly depends on the type of structuring element and the shape of restoring objects. The opening by reconstruction method is able to restore the objects completely after erosion applied.</p>
<h3 id="4312">4.3.12. Threshold</h3>
<p>The threshold operation allows you to store only voxels whose intensity value is between the min and max parameters. All voxels that do not meet this criterion have their intensity that becomes zero. If no value is assigned to min and max then their values will be less the infinite and the less infinite respectively.</p>
<h2>4.4. Procedure to apply a calculation</h2>
<h3 id="441">4.4.1. Load and select a set of nifti collection</h3>
<p>Select one or more colifenings from nifti in the home view. Note that you need at least one collection to access the calculation view</p>
<h3 id="442">4.4.2. Select a calculation and the parameters</h3>
<p>For each algorithm there is a brief description of it to allow the user to know exactly what each algorithm corresponds to. Finally for some algorithm there are parameters that must be entered and can be modified to allow the user to have more flexibility in the use of these.</p>
<div style="padding-left: 15%; padding-top: 1%;padding-bottom: 1%;">
<img src="imgs/calculation/SelectionAlgorithme.png" style="width:80%">
</div>
<h3 id="443">4.4.3. Execute the algorithm and save it in the calculation tab</h3>
<p>Once the user has selected a calculation and initialized all the parameters, he can execute it using the "Calculate" button located at the bottom right of the calculation view.</p>
<div style="padding-left: 15%; padding-top: 1%;padding-bottom: 1%;">
<img src="imgs/calculation/capture.png" style="width:80%">
</div>
<p>When the calculation has successfully run the user to a console return that allows him to have a summary of the calculation that was done with all the input file, the parameters, the nature of the file or output. .. etc. Finally, it is proposed to the user to record or not the calculation result (s).</p>
<div style="padding-left: 15%; padding-top: 1%;padding-bottom: 1%;">
<img src="imgs/calculation/OngletCalculationsEtResultats.png" style="width:80%">
</div>
<h3 id="444">4.4.4. Have an overview of the results in the Edit view</h3>
<p>Once you have saved your calculation result as a set, you can access it by returning to the home view in the calculation tab. You can then, for example, view the rendering in the edition view. Like the two pictures below :</p>
<div style="padding-left: 15%; padding-top: 1%;padding-bottom: 1%;">
<img src="imgs/calculation/Vue3D.png" style="width:80%">
</div>
<div style="padding-left: 15%; padding-top: 1%;padding-bottom: 1%;">
<img src="imgs/calculation/cerveauMorphologie.png" style="width:80%">
</div>
</div>
</div>
</div>
<footer class="w3-container w3-dark-grey w3-padding-32 w3-margin-top">
<div class="column-left">
<p>Source code available on <a href="https://github.com/Brain-Mapper/brainMapper" target="_blank">GitHub repository</a></p>
</div>
<div>
<p> <b>Authors</b>: R. Agathon (@yoshcraft), M. Cluchague (@maximeCluchague), G. Husson (@Graziella-Husson), V. Zelaya (@vz-chameleon)
</div>
</footer>
</body>
</html>