forked from jordandekraker/Hippocampal_AutoTop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingleSubject.m
More file actions
36 lines (32 loc) · 1.03 KB
/
singleSubject.m
File metadata and controls
36 lines (32 loc) · 1.03 KB
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
function singleSubject(inimg,outdir,inlbl,space)
autotop_dir = getenv('AUTOTOP_DIR');
if isempty(autotop_dir)
disp('ERROR: you must set the AUTOTOP_DIR environment variable before running');
quit(1);
end
try addpath(genpath('tools')); end
mkdir(outdir);
outdir = [outdir '/']; % make sure this is a directory
if ~exist('inlbl','var')
inlbl = [];
end
if ~exist('space','var')
space = 'native';
end
Resample_CoronalOblique(inimg,outdir,space,inlbl); % Temporarily removed inlbl for Kayla's data
for LR = 'LR'
inimgLR = [outdir '/hemi-' LR '/img.nii.gz'];
outdirLR = [outdir '/hemi-' LR '/'];
if ~isempty(inlbl)
inlblLR = [outdir '/hemi-' LR '/manual_lbl.nii.gz'];
if exist(inlblLR,'file')
AutoTops_TransformAndRollOut(inimgLR,outdirLR,inlblLR);
else
warning([inlblLR ' not found, proceeding with Automated segmentation']);
end
end
if exist(inimgLR,'file')
AutoTops_TransformAndRollOut(inimgLR,outdirLR);
end
Resample_Native(outdirLR,outdir);
end