-
Notifications
You must be signed in to change notification settings - Fork 19
/
create_freq_specs.m
50 lines (46 loc) · 1.52 KB
/
create_freq_specs.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
function [fspec, a_angs, d] = create_freq_specs(mets, fmid)
% CREATE_FREQ_SPECS - Helper function for creating spectral-spatial
% frequency specifications
%
% [fspec, a_angs, d] = create_freq_specs(mets, fmid);
%
% INPUT
% mets - structure containing:
% mets(i).f - center frequency of bands (Hz)
% mets(i).df - bandwidth of bands (Hz)
% mets(i).ang - flip angle of bands (degress)
% mets(i).d - ripple of bands (Mxy, default = .01)
% fmid [optional] - center frequency spec around fmid
%
% OUTPUT
% spec, a_angs, d - inputs for ss_design()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Spectral-Spatial RF Pulse Design for MRI and MRSI MATLAB Package
%
% Authors: Adam B. Kerr and Peder E. Z. Larson
%
% (c)2007-2014 Board of Trustees, Leland Stanford Junior University and
% The Regents of the University of California.
% All Rights Reserved.
%
% Please see the Copyright_Information and README files included with this
% package. All works derived from this package must be properly cited.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
for n = 1:length(mets)
a_angs(n) = mets(n).ang*pi/180;
fspec(2*n-1) = mets(n).f - mets(n).df;
fspec(2*n) = mets(n).f + mets(n).df;
if isfield(mets(n), 'd') && ~isempty(mets(n).d)
d(n) = mets(n).d;
else
d(n) = .01;
end
end
if nargin < 2 || isempty(fmid)
% by default, center frequency specification
fmid = (min(fspec)+max(fspec))/2;
end
fspec = fspec - fmid;