0001 function [status, results, fg, pathstr] = feTrack(trackingAlgorithm, dtFile,fibersFolder,lmax,nSeeds,wmMask)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if notDefined('trackingAlgorithm'), trackingAlgorithm = {'tensor'};end
0016 if notDefined('dtFile'), dtFile = ...
0017 '/biac2/wandell6/data/frk/LiFE/data/fp20120420/150dirs_b1000_1/dt6.mat';end
0018 if notDefined('wmMask'), wmMask = [];end
0019 if notDefined('fibersFolder'), fibersFolder = ...
0020 '/azure/scr1/frk/150dirs_b1000_b2000_b4000/life_mrtrix_rep1';end
0021 if notDefined('lmax'), lmax = [8];end
0022 if notDefined('nSeeds'), nSeeds = 500000; end
0023
0024 runInBackground = 0;
0025 verbose = 1;
0026
0027
0028 if ~exist(fibersFolder,'dir'), system(sprintf('mkdir -v %s',fibersFolder)); end
0029
0030 fprintf('\n\n[%s] Performing whole-brain tractograpy ...\n\n',mfilename);
0031
0032
0033 for il = 1:length(lmax)
0034
0035
0036 files = mrtrix_init(dtFile, lmax(il),fibersFolder,wmMask);
0037
0038
0039 for ii = 1:length(trackingAlgorithm)
0040
0041 [status, results, fg, pathstr] = mrtrix_track(files, files.brainmask, files.wm, switchAlgo(trackingAlgorithm{ii}), nSeeds, runInBackground, verbose);
0042 end
0043 end
0044
0045 return
0046
0047
0048
0049
0050 function algo = switchAlgo(algo)
0051
0052
0053
0054
0055
0056
0057
0058
0059 if isnumeric(algo)
0060 switch algo
0061 case {1}
0062 algo = 'prob';
0063 case {2}
0064 algo = 'stream';
0065 case {3}
0066 algo = 'tensor';
0067 otherwise
0068 keyboard
0069 end
0070
0071 elseif ischar(algo)
0072 switch algo
0073 case {'prob','probabilistic','mrtrix probabilistic'}
0074 algo = 'prob';
0075 case {'stream','streamline','deterministic', 'mrtrix deterministic'}
0076 algo = 'stream';
0077 case {'tensor','tensor based','mrtrix tensor based tractography'}
0078 algo = 'tensor';
0079 otherwise
0080 keyboard
0081 end
0082
0083 else
0084 keyboard
0085 end