-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathafqConverter1.m
36 lines (28 loc) · 892 Bytes
/
afqConverter1.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 out = afqConverter1()
if ~isdeployed
addpath(genpath('/N/u/brlife/git/vistasoft'));
addpath(genpath('/N/u/brlife/git/jsonlab'));
addpath(genpath('/N/u/brlife/git/o3d-code'));
end
config = loadjson('config.json');
ref_src = fullfile(config.t1_static);
%convert afq to trk
disp('Converting afq to .trk');
%sub1
load(fullfile(config.true_segmentation));
if (config.tract1 > 0)
for tract = [config.tract1]
if (tract > 0)
tract_name=strrep(fg_classified(tract).name,' ','_');
write_fg_to_trk_shift(fg_classified(tract),ref_src,sprintf('%s_tract.trk',tract_name));
end
end
else
for tract=1:20
tract_name=strrep(fg_classified(tract).name,' ','_');
write_fg_to_trk_shift(fg_classified(tract),ref_src,sprintf('%s_tract.trk',tract_name));
fprintf(fid, [tract_name, '\n']);
end
end
exit;
end