forked from BiomedNMR/arrShow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createMultiframeTestphan.m
41 lines (33 loc) · 1 KB
/
createMultiframeTestphan.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
function p = createMultiframeTestphan()
% load the k-space of a predifined multiecho testphantom from file
basePath = fileparts(mfilename('fullpath'));
dat = load(fullfile(basePath, 'testPhan64.mat'));
p = dat.p;
% create a movie with different (simulated) shifts of the phantom
NF = 30; % number of frames
dim = size(p,1);
P = zeros([size(p),NF]);
x = linspace(0,1,dim);
[X,Y] = meshgrid(x,x');
shiftMax = dim * 2*pi;
shiftInc = shiftMax / NF;
shift = 0;
for i = 1 : NF
shiftPhX = exp(1i * -shift * X);
shiftPhY = exp(1i * shift * Y);
shift = shift + shiftInc;
currP = ftimes(p,shiftPhX);
currP = ftimes(currP,shiftPhY);
P(:,:,:,i) = currP;
end
% do a Fourier reconstruction of the data
P = asDataClass.mrIfft(P);
% simulate 4 different coil profiles
coils = cat(5,X,Y,1-X, 1-Y);
P = ftimes(P,coils);
% simulate phase perturbations
phase = exp(1i *2 * pi * (1.5 - coils));
P = ftimes(P,phase);
% create pseudo k-space data from the fft of the images
p = asDataClass.mrFft(P);
end