forked from tonggehua/EPG-simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EPGsim_TSE.m
64 lines (54 loc) · 1.96 KB
/
EPGsim_TSE.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
function [om_store,echoes,seq] = EPGsim_TSE(alpha,N,esp,use_y90,rlx)
%[om_store,echoes,seq] = EPGsim_TSE(alphas,N,esp,use_y90,rlx)
% Simulates EPG of Turbo Spin Echo sequence with an initial
% (90,90) pulse followed by N (0,alpha) pulses
% alpha : flip angle of 2nd to (N+1)th pulses
% N : number of pulses after the initial (90,90) pulse
% esp: TR between pulses (also )
% use_y90: boolean indicating whether we use a (90,90) pulse at the
% beginning (if false, all pulses are (0,alpha))
% rlx: mode of relaxation
if nargin < 4
use_y90 = 1;
rlx = 'none';
end
if ischar(rlx)
switch rlx
case 'none'
seq.T1 = 0; seq.T2 = 0;% zero T1,T2 means no relaxation in relax.m
case 'gm' % gray matter
seq.T1 = 1300; seq.T2 = 110;
case 'wm' % white matter
seq.T1 = 960; seq.T2 = 80;
case 'csf'
seq.T1 = 3600; seq.T2 = 1800;
case 'default'
seq.T1 = 1000; seq.T2 = 100; % same as in EPG paper for reference
end
elseif isequal(size(rlx),[1,2])
seq.T1 = rlx(1); seq.T2 = rlx(2);
else
seq.T1 = 0; seq.T2 = 0; % zero T1,T2 means no relaxation in relax.m
end
dt = esp/2; % time evolves in 0.5*esp steps (dt = 0.5*esp -> dk = 1)
seq.name = 'Turbo Spin Echo';
if use_y90 == 1
seq.rf(:,1) = [90,90]';
seq.rf(:,2:N) = repmat([0,alpha]',1,N-1);
else
seq.rf(:,1:N) = repmat([0,alpha]',1,N);
end
seq.time = [0 dt dt];
seq.events = {'rf','grad','relax'};
for n = 1:N-1
% Order of operators : T(rf)->S(grad)->E(relax) "TSE",easy to remember!
seq.events{end+1} = 'rf';
seq.events{end+1} = 'grad';
seq.events{end+1} = 'relax';
seq.events{end+1} = 'grad';
seq.events{end+1} = 'relax';
seq.time = [seq.time (2*n-1)*dt 2*n*dt 2*n*dt (2*n+1)*dt (2*n+1)*dt];
end
seq.grad = ones(1,2*N-1);
[om_store,echoes] = EPG_custom(seq);
end