-
Notifications
You must be signed in to change notification settings - Fork 98
/
ea_coreg_fa.m
34 lines (33 loc) · 1.28 KB
/
ea_coreg_fa.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
function ea_coreg_fa(options,usebrainmask)
% Coregister FA image to anatomical anchor image.
% Will export FA image from DTI if it doesn't exist yet.
%
% USAGE:
%
% ea_coreg_fa(options,usebrainmask)
%
% INPUTS:
% options: LeadDBS options
% usebrainmask: bool, masking the coregistered image or not
directory=[options.root,options.patientname,filesep];
% check for presence of FA map
if ~exist([directory,options.prefs.fa2anat],'file')
if ~exist([directory,options.prefs.fa],'file')
if ~exist([directory,options.prefs.dti],'file')
fprintf('\n\nNo dMRI data has been found. Proceeding without FA\n\n');
else
ea_isolate_fa(options);
end
end
if exist([directory,options.prefs.fa],'file') % check again since could have been built above
if exist([directory,options.prefs.fa],'file') % recheck if has been built.
ea_backuprestore([directory,options.prefs.fa]);
ea_coregimages(options,[directory,options.prefs.fa],[directory,options.prefs.prenii_unnormalized],[directory,options.prefs.fa2anat]);
end
end
end
if exist([directory,options.prefs.fa2anat],'file') % recheck if now is present.
if usebrainmask
ea_maskimg(options,[directory,options.prefs.fa2anat],bprfx);
end
end