-
Notifications
You must be signed in to change notification settings - Fork 3
/
T1rho_sl_verify.m
81 lines (80 loc) · 2.41 KB
/
T1rho_sl_verify.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
%#######################################################################
%
% * T1rho SLice VERIFY Program *
%
% M-File which plots ROIs on T1rho slices before and after the
% digitized slice to verify the use of the correct slice.
%
% NOTES: 1. Run after running main plotting program
% T1rho_sl_plt.m or loading T1rho MAT file.
%
% RESULTS: 1. Visually looks like the correct slices were used to
% generate masks.
%
% 04-Aug-2020 * Mack Gardner-Morse
%
%#######################################################################
%
% Get Series Description and ROI Names For Legend Entries
%
fs = series_desc{idx};
fs = fs(8:end); % Short series description w/o '3DMAPPS'
fs = strtrim(fs); % File name description
%
rnams = {rois.name}'; % Get names of ROIs
legds = strrep(rnams,'.csv',''); % Create legend entries
%
% Loop through ROI Slices and Plot ROIs
%
lt = ['b.-'; 'g.-'; 'r.-'; 'c.-'; 'm.-'; 'y.-' ]; % Line color and type
%
vnam = [fs 'ROI_sl_verify.ps']; % Verify print file name
%
nrsl = size(rsl,1); % Number of slices with ROIs
%
for k = 1:nrsl
%
% Plot T1rho Slice Images
%
slk = rsl(k); % Slice number in spin lock images
sl = irsl(k); % Slice number in T1rho images
%
for n = -1:1 % Check one slice before and after original slice
figure;
orient landscape;
imagesc(T1rhonls(:,:,sl+n),[0 100]);
colormap gray;
axis image;
axis off;
title([fs ' T1rho Slice ' int2str(sl+n)],'FontSize',16, ...
'FontWeight','bold');
hold on;
%
lh = gobjects(nrfiles,1); % Line graphic handles
idl = false(nrfiles,1);
%
% Get ROI Data for this Slice and Plot ROIs
%
for l = 1:nrfiles
idxr = rois(l).slice==slk;
if any(idxr)
dat = cell2mat(rois(l).roi(idxr).data);
lh(l) = plot(dat(:,1),dat(:,2),lt(l,:));
idl(l) = true;
end
end
%
% Add Legends and Print Slice Plots
%
legend(lh(idl),legds(idl));
%
if n==-1&&k==1
print('-dpsc2','-r600','-fillpage',vnam);
else
print('-dpsc2','-r600','-fillpage','-append',vnam);
end
%
end % End of n loop - 1 slice before through 1 slice after
end % End of k loop - ROI slices loop
%
return