-
Notifications
You must be signed in to change notification settings - Fork 52
/
Model3D_tGeneratorDemo.m
54 lines (46 loc) · 1.67 KB
/
Model3D_tGeneratorDemo.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
% GPLv3 license (ASTRA toolbox)
% Note that the TomoPhantom package is released under Apache License, Version 2.0
% Script to generate 4D analytical phantoms (3D + time)
% If one needs to modify/add phantoms, please edit Phantom3DLibrary.dat
% >>>> Prerequisites: ASTRA toolbox, if one needs to do reconstruction <<<<<
close all;clc;clear;
% adding paths
pathtoModels = sprintf(['..' filesep 'functions' filesep 'models' filesep], 1i);
addpath(pathtoModels);
addpath('compiled'); addpath('supplem');
ModelNo = 100; % Select a model
% Define phantom dimensions
N = 256; % x-y-z size (cubic image)
% generate 4D phantom (modify your PATH bellow):
curDir = pwd;
mainDir = fileparts(curDir);
pathtoLibrary = sprintf([filesep 'functions' filesep 'models' filesep 'Phantom3DLibrary.dat'], 1i);
pathTP = strcat(mainDir, pathtoLibrary); % path to TomoPhantom parameters file
[G] = TomoP3DModel(ModelNo,N,pathTP);
sliceM = round(0.5*N);
figure(1);
for i = 1:5
imagesc(G(:,:,sliceM, i), [0 1]); daspect([1 1 1]); title('3D+t phantom'); colormap hot;
pause(0.1);
end
%%
% another 3D + time model
ModelNo = 101; % Select a model
% Define phantom dimensions
N = 256; % x-y-z size (cubic image)
% generate 4D phantom (modify your PATH bellow):
curDir = pwd;
mainDir = fileparts(curDir);
pathtoLibrary = sprintf([filesep 'functions' filesep 'models' filesep 'Phantom3DLibrary.dat'], 1i);
pathTP = strcat(mainDir, pathtoLibrary); % path to TomoPhantom parameters file
[G] = TomoP3DModel(ModelNo,N,pathTP);
%%
sliceM = round(0.5*N);
figure(2);
ll = 10;
counter = 1;
for ll = 1:5
imagesc(G(:,:,sliceM, ll), [0 1]); daspect([1 1 1]); title('3D+t phantom'); colormap hot;
pause(0.1);
end
%%