-
Notifications
You must be signed in to change notification settings - Fork 1
/
boney_segment_cleanup.m
55 lines (47 loc) · 1.49 KB
/
boney_segment_cleanup.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
function Pout = boney_segment_cleanup(Pout,out,job,i)
%boney_segment_cleanup. Update Pout structure and clean up files
% _________________________________________________________________________
%
% Robert Dahnke & Polona Kalc
% Structural Brain Mapping Group (https://neuro-jena.github.io)
% Departments of Neurology and Psychiatry
% Jena University Hospital
% _________________________________________________________________________
% xml file and report
Pout.xml{i} = out(i).P.xml;
Pout.reports{i} = out(i).P.report;
if job.output.writeseg == 1
for ci = 1:5
Pout.cls{ci}{i} = out(i).P.cls{ci};
end
elseif 0
% delete preprocessing segments
for ci = 1:5
if exist( out(i).P.cls{ci} , 'file')
delete( out(i).P.cls{ci} );
end
end
end
% boney volume files
if job.output.writevol
Pout.rbone_affine{i} = out(i).P.rbone_affine;
Pout.rbone{i} = out(i).P.bone;
else
% delete files
end
% boney surface files
if job.output.writesurf
Pout.bcentral{i} = out(i).P.central;
Pout.bcortex{i} = out(i).P.cortex;
Pout.bmarrow{i} = out(i).P.marrow;
Pout.bthickness{i} = out(i).P.thick;
Pout.hthickness{i} = out(i).P.headthick;
elseif job.opts.bmethod == 2 % surface processing
FD = {'central','cortex','marrow','thick','headthick'};
for fdi = 1:numel(FD)
if exist( out(i).P.(FD{fdi}) , 'file')
delete( out(i).P.(FD{fdi}) );
end
end
end
end