-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.m
48 lines (40 loc) · 1.91 KB
/
example.m
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
% The following code illustrates some use cases of MrVox2d
addpath(genpath(fullfile(pwd, 'mrvox')));
%% FID example
fprintf('\n\t>> Simulating a FID on simple voxel...\n\n');
[sa, sphi] = VoxelSim2D_do_one('config/voxpar_simple.txt', 'config/seqpar_fid.txt');
fprintf('\n\n[Press any key to continue]\n\n')
pause
close all
%% Spin echo example
fprintf('\n\t>> Simulating a spin echo on simple voxel...\n\n');
[sa, sphi] = VoxelSim2D_do_one('config/voxpar_simple.txt', 'config/seqpar_se.txt');
fprintf('\n\n[Press any key to continue]\n\n')
pause
close all
%% Spin echo example with strong susceptibility and reduced diffusion
fprintf('\n\t>> Simulating a spin echo on voxel with higher susceptibility and lower diffusion...\n\n');
[sa, sphi] = VoxelSim2D_do_one('config/voxpar_simple_highsusc_lowdiff.txt', 'config/seqpar_se.txt');
fprintf('\n\n[Press any key to continue]\n\n')
pause
close all
%% Stimulated echo example
fprintf('\n\t>> Simulating a spin echo on simple voxel...\n\n');
[sa, sphi] = VoxelSim2D_do_one('config/voxpar_simple_highsusc_lowdiff.txt', 'config/seqpar_stim.txt');
fprintf('\n\n[Press any key to continue]\n\n')
pause
close all
%% Narrow diffusion gradient example with hindered diffusion and cells
fprintf('\n\t>> Simulating a narrow diffusion gradient on simple voxel...\n\n');
[sa, sphi] = VoxelSim2D_do_one('config/voxpar_simple_hindered_cell.txt', 'config/seqpar_narrowpulse_singlerefoc.txt');
fprintf('\n\n[Press any key to continue]\n\n')
pause
close all
%% Dictionary generation example
fprintf('\n\t>> Simulating a dictionary on a simplistic voxel with varying vessel radius...\n\n');
dico = GenLookUp2D('config/voxpar_dico.txt', 'config/seqpar_GESFIDE.txt');
% Just to get input parameters for plotting legend
Model = ReadModel('config/voxpar_dico.txt');
figure,plot(abs(dico')), xlabel('Time (ms)'), ylabel('MR signal magnitude')
title('Dictionary')
legend(cellstr(num2str(Model.geo.vasc.R'*1e6, 'R=%-dum')))