-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquantify_phase_shim_TXfct.m
59 lines (51 loc) · 1.82 KB
/
quantify_phase_shim_TXfct.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
function ValueStruct = quantify_phase_shim_TXfct(shimset, b1p, roi, varargin)
%% ************************************************************************
%
% Quantifies the coefficient of variation and the efficiency for phase
% shimming
%
% Author: S.Schmitter
% Date: Jan 2016
%
%
% dependencies:
% - multiprod
% - parseVariableInputs
% - catstruct
%
% INPUT: [unit]
% ----------------------------------------------------------------
% shimset coplex vector of phase shim values
% b1p b1+ maps
% roi region of interest
%
% Options (with standard prefs) [unit]
% ----------------------------------------------------------------
%
%
% OUTPUT:
% ----------------------------------------------------------------
% ValueStruct Struct containing the quantified values
%
%% ************************************************************************
optsdef.TEST = 0;
optsdef.SAVEMAPS = 0;
opts = catstruct(optsdef,parseVariableInputs(varargin));
shimvec = makeColVec(shimset);
b1pat = multiprod(b1p,shimvec,4,1);
b1sumofmag = multiprod(abs(b1p),abs(shimvec),4,1);
EfficiencyMap = abs(b1pat)./b1sumofmag;
ValueStruct.Efficiency = mean(EfficiencyMap(~~roi));
ValueStruct.EfficiencyMin = min(EfficiencyMap(~~roi));
ValueStruct.EfficiencyMax = max(EfficiencyMap(~~roi));
tmp = abs(b1pat(~~roi));
ValueStruct.CV = std(tmp)/mean(tmp);
if(opts.SAVEMAPS)
ValueStruct.B1map = b1pat;
ValueStruct.EfficiencyMap = EfficiencyMap;
else
ValueStruct.B1map = [];
ValueStruct.EfficiencyMap = [];
end
ValueStruct.ROIsize = sum(roi(:));
end