-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcoreg_qc.m
More file actions
63 lines (45 loc) · 1.37 KB
/
Copy pathcoreg_qc.m
File metadata and controls
63 lines (45 loc) · 1.37 KB
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
function coreg_qc(subject,pet_image,mr_image)
% Visualizes orthogonal slices of PET and MR images. The MRI is shown as a
% red overlay on top of the PET image. The visualization is saved to the
% subject's qc file.
% Define values related to positioning of the slices
d = 0.05;
w = 0.8/3;
h = 0.8;
y = 0.1;
N = 4; % number of slices
% Define the slices (in millimiters) that are shown
xx = [-15 -5 5 15];
yy = [-20 0 10 40];
zz = [-20 0 20 40];
ff = figure('Position',[10 10 900 1200],'Visible','Off');
for i = 1:N
fig = spm_figure('Create','Graphics','','off');
fig.Position = [796 25 1200 400];
clear global st
k = spm_orthviews('image',pet_image);
spm_orthviews('AddColouredImage',k,mr_image,[1 0 0]);
spm_orthviews('Xhairs','off')
spm_orthviews('reposition',[xx(i) yy(i) zz(i)]);
spm_orthviews('redraw');
ax = fig.Children;
ax(1).Position(1) = d;
ax(2).Position(1) = 2*d+w;
ax(3).Position(1) = 3*d+2*w;
ax(1).Position(2) = y;
ax(2).Position(2) = y;
ax(3).Position(2) = y;
ax(1).Position(3) = w;
ax(2).Position(3) = w;
ax(3).Position(3) = w;
ax(1).Position(4) = h;
ax(2).Position(4) = h;
ax(3).Position(4) = h;
figstruct = getframe(fig);
close(fig);
X = figstruct.cdata;
subplot(N,1,i); imshow(X);
end
add_to_qc_pic(subject,ff)
close(ff);
end