forked from netstim/leaddbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathea_coregmr_ants.m
35 lines (32 loc) · 2.17 KB
/
ea_coregmr_ants.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
function ea_coregmr_ants(options,refine)
% uses ANTs to coregister MRIs.
if ~exist('refine','var')
refine=0;
end
if exist([options.root,options.patientname,filesep,options.prefs.tranii_unnormalized],'file') &&...
~ea_coreglocked(options,[options.root,options.patientname,filesep,options.prefs.tranii_unnormalized]) % file has already been locked and approved by used
disp('Coregistering postop MR tra to preop MRI...');
ea_ants([options.root,options.patientname,filesep,options.prefs.prenii_unnormalized],...
[options.root,options.patientname,filesep,options.prefs.tranii_unnormalized],...
[options.root,options.patientname,filesep,options.prefs.tranii_unnormalized],...
options.prefs.mrcoreg.writeoutcoreg,{},refine,options);
disp('Coregistration done.');
end
if exist([options.root,options.patientname,filesep,options.prefs.cornii_unnormalized],'file') &&...
~ea_coreglocked(options,[options.root,options.patientname,filesep,options.prefs.cornii_unnormalized]) % file has already been locked and approved by used
disp('Coregistering postop MR cor to preop MRI...');
ea_ants([options.root,options.patientname,filesep,options.prefs.prenii_unnormalized],...
[options.root,options.patientname,filesep,options.prefs.cornii_unnormalized],...
[options.root,options.patientname,filesep,options.prefs.cornii_unnormalized],...
options.prefs.mrcoreg.writeoutcoreg,{},refine,options);
disp('Coregistration done.');
end
if exist([options.root,options.patientname,filesep,options.prefs.sagnii_unnormalized],'file') &&...
~ea_coreglocked(options,[options.root,options.patientname,filesep,options.prefs.sagnii_unnormalized]) % file has already been locked and approved by used
disp('Coregistering postop MR sag to preop MRI...');
ea_ants([options.root,options.patientname,filesep,options.prefs.prenii_unnormalized],...
[options.root,options.patientname,filesep,options.prefs.sagnii_unnormalized],...
[options.root,options.patientname,filesep,options.prefs.sagnii_unnormalized],...
options.prefs.mrcoreg.writeoutcoreg,{},refine,options);
disp('Coregistration done.');
end