-
Notifications
You must be signed in to change notification settings - Fork 98
/
ea_coregpostopct.m
49 lines (41 loc) · 1.64 KB
/
ea_coregpostopct.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
function done = ea_coregpostopct(options)
% Entry function to coregister post-op CT to pre-op MRI
done = 0;
if ~ea_reglocked(options, options.subj.postopAnat.CT.coreg)
% Setup log
if options.prefs.diary
ea_mkdir(fileparts(options.subj.coreg.log.logBaseName));
diary([options.subj.coreg.log.logBaseName, 'CT', datestr(now, 'yyyymmddTHHMMss'), '.log']);
end
% Do coregistration
switch lower(options.coregct.method)
case lower({'ANTs (Avants 2008)', 'ANTs'})
ea_coregpostopct_ants(options);
case lower({'ANTs (Avants 2008) multiple runs', 'ANTsMulti'})
ea_coregpostopct_ants_multiple(options);
case lower({'BRAINSFit (Johnson 2007)', 'BRAINSFit'})
ea_coregpostopct_brainsfit(options);
case lower({'FLIRT (Jenkinson 2001 & 2002)', 'FLIRT'})
ea_coregpostopct_fsl(options);
case lower({'FLIRT (Jenkinson 2001 & 2002) multiple runs', 'FLIRTMulti'})
ea_coregpostopct_fsl_multiple(options);
otherwise
warning('Coregistrion method not recognized...');
diary off;
return;
end
% Dump method
ea_dumpmethod(options, 'coreg', 'CT');
% Compute tone-mapped coregistered CT
if strcmp(options.subj.postopModality, 'CT')
ea_tonemapct(options, 'native');
end
if options.prefs.diary
diary off;
end
if options.overwriteapproved && isfolder(options.subj.brainshiftDir)
ea_delete(options.subj.brainshiftDir);
ea_cprintf('CmdWinWarnings', 'CT coregistration has been rerun. Please also rerun brain shift correction!\n');
end
done = 1;
end