forked from MIITT-MRI-Jianglab/Abdominal_MR_Phantom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setseqparam.m
87 lines (82 loc) · 3.02 KB
/
setseqparam.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
function [seqparam,defseq] = setseqparam(sigtype,matsize,sampmode)
% Define sequence parameters
%
% INPUTS:
% sigtype [string] -> signal type defined by user
% matsize [1 x 3] -> [np npar nset]
% np = # of projections
% npar = # of partitions
% nset = # of sets
% OPTIONAL:
% sampmode [string] -> sampling mode defined by user
%
% OUTPUT:
% seqparam [struct] -> sequence parameters
%
% -----------------------------------------------------------------------------------------
% Realistic 4D abdominal phantom for magnetic resonance imaging
% Wei-Ching Lo
% wxl317@case.edu
% Case Western Reserve University
% April 2018
% -----------------------------------------------------------------------------------------
np = matsize(1);
npar = matsize(2);
nset = matsize(3);
defseq = [];
if exist(fullfile('seqparam',sigtype),'file') == 2
eval(sigtype)
else
error('Please select defined sequence type or define new sequence parameters in folder "seqparam"');
end
seqparam.samppat = samppattern(defseq.samptype,[np npar nset]);
baseTR = defseq.baseTR; % sec
baseTE = defseq.baseTE; % sec
FA = defseq.FA; % degrees
TRinprep = defseq.TRinprep; % # of TRs in one preparation
TRinex = defseq.TRinex; % # of TRs in one excitation
nprep = defseq.nprep; % # of preparations
phaseang = defseq.phaseang; % degrees
preppausetime = defseq.preppausetime; % sec
dfrange = defseq.dfrange; % off-resonance in Hz
fatsat = defseq.fatsat; % fat saturation
prepind = defseq.prepind; % preparation module
% Prepare preparation matrix
seqparam.prep = padarray(repmat(1*prepind,[1,nprep]),TRinprep/TRinex-1,'post');
if prepind == 1
ti = padarray(repmat(20.64/1000,[1,nprep]),TRinprep/TRinex-1,'post');
else
ti = padarray(zeros(1,nprep),TRinprep/TRinex-1,'post');
end
if ~isfield(defseq,'t2prep')
t2prep = zeros([1,nprep]);
else
t2prep = defseq.t2prep; % time to preparation
end
if ~isfield(seqparam,'perfT1')
seqparam.perfT1 = zeros([nprep,4]);
end
t2te = padarray(t2prep,TRinprep/TRinex-1,'post');
patime = padarray(repmat(preppausetime,[1,nprep]),TRinprep/TRinex-1,'post');
Nex = TRinprep/TRinex*nprep;
Necho = TRinex;
seqparam.FAmat = repmat(FA/180*pi,TRinprep/TRinex,nprep);
seqparam.TRmat = baseTR+ti+t2te+patime;
seqparam.TEmat = reshape(repmat(baseTE,TRinprep/TRinex,nprep)+repmat(t2prep,TRinprep,1),[Nex Necho]);
seqparam.phase = mod(phaseang*pi/180*ones(1,TRinprep*nprep)',2*pi);
seqparam.spoiler = ones(TRinprep/TRinex,nprep);
seqparam.dfrange = dfrange;
seqparam.Nex = Nex;
seqparam.Necho = Necho;
seqparam.sigtype = sigtype;
seqparam.ti = ti;
seqparam.fatsat = fatsat;
if strcmp(sampmode,'simple')
if strcmp(defseq.samptype,'projinpar')
defseq.demosig = 1:np:TRinprep*nprep;
elseif strcmp(defseq.samptype,'parinproj')
defseq.demosig = 1:npar:TRinprep*nprep;
end
elseif strcmp(sampmode,'eachEcho')
defseq.demosig = 1:TRinprep*nprep;
end