-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathismrm_calculate_jer_unmixing.m
75 lines (66 loc) · 2.51 KB
/
ismrm_calculate_jer_unmixing.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
function unmix = ismrm_calculate_jer_unmixing(jer_lookup, acc_factor, ccm, regularization_scale, verbose)
%
% unmix = ismrm_calculate_jer_unmixing(jer_lookup, acc_factor, ccm, regularization_scale, verbose)
%
% Calculates channel-by-channel local k-space unaliasing kernels based on
% the provided joint-encoding relations and acceleration factor.
%
% Transforms these kernels to image space and merges them with the
% provided channel combination maps to create unmixing images.
%
% INPUT:
% jer_lookup [kx,ky,coil, kx, ky, coil] : Lookup table of joint
% encoding relations. Kernel
% extent take from jer size.
% acc_factor scalar : Acceleration factor, e.g. 2
% ccm [x,y,coil] : Channel combination maps
% regularization_scale scalar : Controls aggressiveness of Tychonov
% regularization during calculation of
% unaliasing kernels.
% 0 = no regularization;
% 0.001 = default;
% higher for more aggressive
% regularization.
% verbose bool : Set true for verbose output
%
% OUTPUT:
% unmix [x,y,coil] : Image unmixing coefficients
%
%
% Code made available for the ISMRM 2013 Sunrise Educational Course
%
% Michael S. Hansen ([email protected])
% Philip J. Beatty ([email protected])
%
%%
% Compute unaliasing kernels
if (verbose),
fprintf('Calculating unaliasing kernels...\n');
end
%tic
kernel_size = [size(jer_lookup,1) size(jer_lookup,2)];
target_location = bitshift(kernel_size, -1)+1;
num_channels = size(ccm, 3);
kernel = zeros(kernel_size(1),kernel_size(2), num_channels, num_channels);
for ic = 1:num_channels,
kernel(target_location(1), target_location(2), ic, ic) = 1;
end
for s=1:(acc_factor-1),
kernel_mask = zeros(kernel_size);
kernel_mask(:,s:acc_factor:end) = 1;
k = ismrm_compute_kspace_unaliasing_coefficients(jer_lookup, kernel_mask, regularization_scale);
kernel = kernel + k;
end
%toc
%%
% Form unmixing images from channel combination maps and kernels
if (verbose),
fprintf('Merging unaliasing and channel combination images...\n');
end
%tic
unmix = ismrm_calculate_unmixing_images_from_kspace_kernels(kernel, ccm);
%toc
if (verbose),
fprintf('done.\n');
end
return