Phantom

Phantom model is essential to perform a MRI simulation. Basicly a digital phantom can be described with a group of multidimensional matrix (usually 3D), which contains necessary physical distributions such as T1 and T2. Alternatively, a more flexible way is to use an unique matrix to describe the tissue distribution, in which voxels corresponding to the same tissue have identical element value (e.g. 12 for brain white matter, 0 for background). Moreover, a parameter list can be attached to further describe the corresponding material properties (T1, T2, and so on).

Phantom visualization

As mentioned above, to load a phantom, both tissue distribution file (in HDF5 format) and its parameter list file are required.
local mida = phantom("mida.h5", "mida_config.txt")

The parameter list data contains at least three columns and each row describes a corresponding tissue property like 1 1260 109, which means tissue index 1, T1 time 1260 ms and T2 time 109 ms respectively.

To view slices along different directions:

mida:view{x=240, y=240, z=175}

mida1 mida2 mida3

By default, the T2 map of specified slices are shown. There is also an additional option prop to specify map type. E.g.
mida:view{prop="T1", z=175}

gives a T1 map at slice number 175 along z axis.

mida4

How to create phantom

We provide following demo scripts (Matlab) for researchers to design their own phantom models in Spin-Scenario. There is also a C/C++ routine to convert a 3D mhd phantom into Spin-Scenario’s h5 format, and a routine to convert Spin-Scanerio’s h5 output into mhd file, written and shared by Dr. Jörg Peter from German Cancer Research Center (DKFZ).

2D phantom

 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
% STEP1: create a 2d phantom pattern (3 circles)
phantom_name = 'circles.h5';
% resolution 
dx = 1; % mm 
dy = 1; % mm

x = -100:dx:100; % x range
y = -80:dy:80; % y range
[posx posy] = meshgrid(x,y);
tissue_distrib = zeros(size(posx)); % background value 0.
tissue_distrib((posx.^2 + posy.^2)<25^2)= 1;   % radius 25, center at the origin, tissue index 1.
tissue_distrib(((posx - 50).^2+(posy - 50).^2)<15^2)= 2;   % radius 15, center at (50,50), tissue index 2.
tissue_distrib(((posx + 50).^2+(posy + 50).^2)<15^2)= 3;   % radius 15, center at (-50,-50),tissue index 3.
% plot the phantom
imagesc(tissue_distrib)
%---------------------------------------------------------------------
% STEP2: create the h5 phantom file.
if exist(phantom_name,'file')==2
    delete(phantom_name);
end

res=[dx dy]*1e-3; % unit in m.
h5create(phantom_name, '/phantom/resolution', size(res));
h5write(phantom_name, '/phantom/resolution', res);

tissue_distrib = uint16(tissue_distrib);
h5create(phantom_name, '/phantom/tissue_dist', size(tissue_distrib), 'Datatype', 'uint16');
h5write(phantom_name, '/phantom/tissue_dist', tissue_distrib);
local p1 = phantom("circles.h5", "config.txt")
p1:view{prop="T1", z=1}

circles

3D phantom

 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
% STEP1: create a 3d phantom pattern (3 spheres)
phantom_name = 'spheres.h5';
% resolution 
dx = 1; % mm 
dy = 1; % mm
dz = 1; % mm
x = -100:dx:100; % x range
y = -80:dy:80; % y range
z = -50:dz:50;
[posx posy posz] = meshgrid(x,y,z);
tissue_distrib = zeros(size(posx)); % background value 0.
tissue_distrib((posx.^2 + posy.^2 + posz.^2)<25^2)= 1; % radius 25, center at the origin, tissue index 1.
tissue_distrib(((posx - 50).^2 + (posy - 50).^2 + posz.^2)<15^2)= 2; % radius 15, center at (50,50, 0), tissue index 2.
tissue_distrib(((posx + 50).^2 + (posy + 50).^2 + posz.^2)<15^2)= 3; % radius 15, center at (-50,-50, 0),tissue index 3.
% plot the phantom
isosurface(posx, posy, posz, tissue_distrib, 0);
%---------------------------------------------------------------------
% STEP2: create the h5 phantom file.
if exist(phantom_name,'file')==2
    delete(phantom_name);
end

res=[dx dy dz]*1e-3; % unit in m.
h5create(phantom_name, '/phantom/resolution', size(res));
h5write(phantom_name, '/phantom/resolution', res);

tissue_distrib = uint16(tissue_distrib);
h5create(phantom_name, '/phantom/tissue_dist', size(tissue_distrib), 'Datatype', 'uint16');
h5write(phantom_name, '/phantom/tissue_dist', tissue_distrib);
local p2 = phantom("spheres.h5", "config.txt")
p2:view{x=100, y=30, z=50}

spheres1 spheres2 spheres3