forked from netstim/leaddbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ea_coregmr.m
53 lines (45 loc) · 1.89 KB
/
ea_coregmr.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
function ea_coregmr(options)
% wrapper for coreg routines
% in CT imaging, coregistration is done elsewhere.
% also ignore when there is no tra/cor/sag existing (normal conn study)
if options.modality == 2 || ~isfield(options.prefs,'tranii_unnormalized')
return
end
directory=[options.root,options.patientname,filesep];
doreslice=1;
% restore raw files -> postop files from prior attempts. & make backups
% from original files in any case.
try
if ~ea_coreglocked(options,[directory,options.prefs.tranii_unnormalized]) % file has already been locked and approved by used
ea_backuprestore([directory,options.prefs.tranii_unnormalized]);
end
end
try
if ~ea_coreglocked(options,[directory,options.prefs.cornii_unnormalized]) % file has already been locked and approved by used
ea_backuprestore([directory,options.prefs.cornii_unnormalized]);
end
end
try
if ~ea_coreglocked(options,[directory,options.prefs.sagnii_unnormalized]) % file has already been locked and approved by used
ea_backuprestore([directory,options.prefs.sagnii_unnormalized]);
end
end
switch options.coregmr.method
case 'SPM' % SPM
ea_coregmr_spm(options,doreslice);
case 'FSL FLIRT' % FSL FLIRT
ea_coregmr_flirt(options);
case 'FSL BBR' % FSL FLIRT
ea_coregmr_flirt_bbr(options);
case 'ANTs' % ANTs
ea_coregmr_ants(options,0);
case 'BRAINSFIT' % BRAINSFit
ea_coregmr_brainsfit(options);
case 'Hybrid SPM & ANTs' % Hybrid SPM -> ANTs
ea_coregmr_spm(options,0); % dont use doreslice here to refrain for doing two interpolations.
ea_coregmr_ants(options);
case 'Hybrid SPM & BRAINSFIT' % Hybrid SPM -> Brainsfit
ea_coregmr_spm(options,0); % dont use doreslice here to refrain for doing two interpolations.
ea_coregmr_brainsfit(options);
end
ea_dumpnormmethod(options,options.coregmr.method,'coregmrmethod');