forked from mrirecon/bart
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
392 lines (223 loc) · 10 KB
/
README
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
0. License
==========
See LICENSE file for licensing information.
-------------------------------------------------------------------------------
The tools in this software implement various reconstruction algorithms for
Magnetic Resonance Imaging. The software is intended for research use only
and NOT FOR DIAGNOSTIC USE. It comes without any warranty (see LICENSE for
details).
Please cite the corresponding articles when using these tools.
Some references can be found at the end of this file. The source code might
provide more detailed references, e.g. for specific iterative algorithms.
1. Help
=======
Please direct all questions or comments to the public mailing list:
https://lists.eecs.berkeley.edu/sympa/info/mrirecon
Note: This list has a public archive! Please do not send
any confidential information.
Updates and further information can be found here:
http://mrirecon.github.io/bart/
2. Installation
===============
2.1. Prerequisites
------------------
GCC compiler, the FFTW library, and optionally CUDA.
(see recon/Makefile to turn options on or off)
The software can be used in combination with Matlab or octave.
There is limited support for reading Cartesian data encoded with
the ISMRM Raw Data format when linking with the ISMRMRD library
(http://ismrmrd.sourceforge.net/).
In the following, the symbol '`$`' indicates a shell prompt.
Do not type '`$`' when entering commands.
### 2.1.1. Linux
The software tools in recon should run on any recent Linux distribution.
To install the required libraries on Debian and Ubuntu run:
$ sudo apt-get install gcc make libfftw3-dev liblapacke-dev libpng-dev libopenblas-dev
(optional)
$ sudo apt-get install octave
(optional)
install version 0.5.2 of the ISMRMRD library
### 2.1.2. Mac OS X
Xcode is required and it is recommended to install a newer version
of gcc (4.7 seems to work) from MacPorts (http://www.macports.org/).
$ sudo port install fftw-3-single
$ sudo port install gcc47
$ sudo port install libpng
$ sudo port install openblas
(optional)
$ sudo port install octave
(optional)
install version 0.5.2 of the ISMRMRD library
### 2.1.3. Windows
The recommended way to use BART on Windows is with the Windows Subsystem for
Linux (WSL) which is available for Windows 10.
BART should also work with Cygwin:
https://www.cygwin.com/
Install Cygwin and select the following packages:
Devel: gcc, make
Math: fftw3, fftw3-doc, libfftw3-devel, libfftw3_3
Math: liblapack-devel, liblapack-doc, liblapack0
Libs: libpng, libpng-devel
Then use the cygwin shell to compile BART as described below.
An alternative to using the Windows Subsystem for Linux or Cygwin
is a virtual machine with Linux installed.
2.2. Downloading and Compilation
--------------------------------
If you are a git user, you can simply clone our public repository:
$ git clone https://github.com/mrirecon/bart
Otherwise, please download the latest version as a zip file
from Github:
http://github.com/mrirecon/bart/releases/latest
and unpack it somewhere on your computer.
Open a terminal window and enter the bart directory (the top-level
directory with the Makefile in it). To build the reconstruction
tools type:
$ make
If you have installed the ISMRMRD library version 0.5.2, you can also
build the ISMRM raw data import tool:
$ make ismrmrd
2.3. Getting Started
--------------------
### 2.3.1. Organization
. main directory / built software tools
Makefile Makefile
matlab/ Matlab helper scripts
python/ Python helper functions
doc/ documentation
rules/ more built-related files
scripts/ various helper scripts and examples
src/ source code
src/calib source code for sensitivity calibration
src/sense source code for SENSE or ESPIRiT reconstruction
src/noir source code for nonlinear inversion
src/sake source code for SAKE reconstruction
src/wavelet source code for wavelets
src/num base library with numerical functions
src/iter iterative algorithms
src/linops library of linear operators
src/misc miscellaneous (e.g. I/O)
src/ismrm support for ISMRM raw data format
src/simu source code for simulation
src/noncart source code for non-uniform FFT
tests/ system tests
utests/ unit tests
lib/ built software libraries
### 2.3.2. Terminal
When using the toolbox commands from a UNIX shell, it is recommended
to set the TOOLBOX_PATH to the base directory and to add it to
the PATH variable. You can do this by running the following command:
$ . startup.sh
Note: The dot or 'source' command is needed so that the variables
are imported into the current shell.
### 2.3.3. Matlab
You can set the TOOLBOX_PATH to the base directory and to add it
to the Matlab path by running the following command in the
bart directory:
>> startup
(Note: The '>>' indicates the shell prompt. Do not type '>>'
when entering commands.)
You can use Matlab to read and visualize/process files. To write
a data file 'xyz' from Matlab you can run:
>> writecfl('xyz', A);
Note, that the name 'xyz' is used without filename extension.
See below for more information about the file format used in BART.
To read the data file 'xyz' back into Matlab use:
>> A = readcfl('xyz');
To call a BART tool (e.g. ecalib) from Matlab, you can use the
'bart' command:
>> sensitivities = bart('ecalib', kspace);
Download and unpack the examples which demonstrate interoperability
with Matlab. Go to the examples directory and run:
>> examples
### 2.3.4. Python
You can set the TOOLBOX_PATH to the base directory and start a
Python interactively as follows:
$ python -i startup.py
You can use Python to read and visualize/process files. To write
a data file 'xyz' from Python you can run:
>>> cfl.writecfl('xyz', A);
Note, that the name 'xyz' is used without filename extension.
See below for more information about the file format used in BART.
To read the data file 'xyz' back into Python use:
>>> A = cfl.readcfl('xyz');
To call a BART tool (e.g. ecalib) from Python, you can use the
'bart' command:
>>> sensitivities = bart(1, 'ecalib', kspace);
The bart function expects the following signature:
>>> <outputs> = bart(<nargout>, <command>, <arguments>, ...)
To use BART in a script, please follow the steps in the
startup.py file.
3. Data Format
==============
3.1. Generic
------------
The input and output datasets are each stored in a pair of files: one
header (*.hdr) and one raw data (*.cfl). The header is a simple text
readable file that describes the dimensions of the data. The raw data
file is a binary file containing a single contiguous block of array
data of dimensions described in the header stored in column-major order
(first index is sequential). The raw data file is complex float
(32 bit real + 32 bit imaginary, IEEE 747 binary32 little-endian).
Convenience methods to read and write our data files using Matlab may
be found in the matlab/ directory (readcfl.m and writecfl.m). Similar
methods for Python may be found in the python/ directory (cfl.py).
3.2. Magnetic Resonance Imaging Data
------------------------------------
For MRI data and images, the dimensions are usually assigned in
the following order:
0 readout
1 phase-encoding dimension 1
2 phase-encoding dimension 2
3 receive channels
4 ESPIRiT maps
...
...
(more dimensions are defined in src/misc/mri.h)
Undersampled data is stored with zeros in the unsampled
positions.
3.3. Non-Cartesian Trajectories and Samples
-------------------------------------------
The k-space coordinates for each sample are stored along dimension 0
which must have size equal to three. The unit of measurement is 1/FOV.
Dimension 1 stores the samples along a single readout windows while
dimension 2 may be used to differentiate between different lines
(e.g. radial spokes). Channel (3) and map (4) dimensions must not
be used (i.e. have size one), while other dimensions can be used
as for Cartesian data. Non-Cartesian samples are stored in a similar
way as trajectories except that dimension 0 is not used. The channel
dimension can be used for different receiver coils as usual.
4. Command-line Tools
=====================
All tools operate on the simple file format given above. Indices and
dimensions run from 0 to N-1. Sometimes a set of dimensions is given
as a bitmask where the lowest bit corresponds to the 0st dimension.
For example, an inverse Fourier transform of first three dimensions can
be performed with the following command:
$ bart fft -i 7 kspace volume
More information about each command can be found in 'doc/commands.txt'.
5. Information for Contributors
===============================
Thank you for helping to improve BART! In order for us to be able
to accept your contribution, it has to be released under the BSD
license used by BART (see LICENSE file). By submitting patches to
us it is understood that you agree to these terms and that you
confirm that you hold all necessary rights yourself or have
permission from the copyright holder. Please also add the name of
the copyright holder and name and email of the author(s) to the
copyright headers in all new or changed files.
6. References
=============
* Tamir JI, Ong F, Cheng JY, Uecker M, Lustig M,
Generalized Magnetic Resonance Image Reconstruction using
The Berkeley Advanced Reconstruction Toolbox, ISMRM Workshop
on Data Sampling and Image Reconstruction, Sedona 2016
* Uecker M, Ong F, Tamir JI, Bahri D, Virtue P, Cheng JY, Zhang T, Lustig M,
Berkeley Advanced Reconstruction Toolbox, Annual Meeting ISMRM, Toronto 2015
In: Proc Intl Soc Mag Reson Med 23:2486
* Uecker M, Virtue P, Ong F, Murphy MJ, Alley MT, Vasanawala SS, Lustig M,
Software Toolbox and Programming Library for Compressed Sensing and
Parallel Imaging, ISMRM Workshop on Data Sampling and Image
Reconstruction, Sedona 2013
References related to implemented methods and algorithms can be
found in the file 'doc/references.txt'.