forked from MIITT-MRI-Jianglab/Abdominal_MR_Phantom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gencmap.m
34 lines (30 loc) · 1.15 KB
/
gencmap.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
function cmap = gencmap(matsize,nc,origcmap)
% Generate coil maps
%
% INPUTS:
% matsize [any size] -> matrix size defined by user (2D or 3D)
% nc [1x1] -> # of coils
%
% Optional arguments:
% origcmap [any size] -> pre-loaded coil sensitivity map that will be resized to the defined matrix size
%
% OUTPUT:
% cmap [any size] -> coil sensitivity maps (2D or 3D)
%
% -----------------------------------------------------------------------------------------
% Realistic 4D abdominal phantom for magnetic resonance imaging
% Wei-Ching Lo
% wxl317@case.edu
% Case Western Reserve University
% May 2018
% -----------------------------------------------------------------------------------------
if nargin == 2
% create simulated coil sensitivity maps
cmap = generateCoilMap(matsize,nc);
elseif nargin == 3
% resize loaded coil sensitivity maps
orignc = size(origcmap,3);
selc = round(linspace(1,orignc,nc));
cmapc = imresize(origcmap(:,:,selc),[matsize(1) matsize(2)],'nearest');
cmap = permute(imresize(permute(cmapc,[4 2 1 3]),[matsize(3) matsize(2)],'nearest'),[2 3 4 1]);
end