#!/bin/tcsh -f # ver=3.0 # Do some probabilistic tractography, using networks of ROIs derived # from RS-FMRI and DTI data/uncertainty. There are a few different # options for outputs and things, so good to look through helpfile. # This uses outputs of 3dDWItoDT, 3dROIMaker and 3dDWUncert. # This program will: # Treat each '-netrois' brik as a network of ROIs, each ROI labelled # by a distinct integer. # It uses the previous uncertainty estimates to perturb the DTI # parameters for each run of wholebrain tractography of this Monte # Carlo simulation; the number of iterations and 'seeds' per voxel per # iteration is defined by the user (defaults: 5 seeds per voxel and # 1000 iterations). # In addition to the standard FACTID parameters of tract propagation # (min FA, max turning angle, min tract length), there is also an # algorithm option for determining if a voxel has had enough tracts # run through it to be included in the WM-ROI for a given connection. # It's defined as a decimal times: (the number of iterations) x (the # total number of seeds per voxel per iteration). Thus, if you have # 200 iterations and 5 seeds/vox/iter, then an option value of 0.001 # would require just 0.001*200*5=1 tract through a voxel to include it # as part of a 'WM region' connecting two network ROIs. (NB: the # tract-threshold number is floored at 1, so you can't undershoot # that.) (Another NB: sometimes the rounding of floating point # multiplication can be a bit funny, so you might set your fraction # value to something like 0.0011 if it's not what you want, # precisely.) # The example here has a small number of total iterations, probably # less than a desired value in actual analysis (consider the default # values as being a better starting point for more serious # running). The algopt file used here is the 'plain text' variety, # just a column of numbers, which for the PROB mode represent: # alg_Thresh_FA, alg_Thresh_ANG, alg_Thresh_Len, # alg_Thresh_Frac, alg_Nseed_Vox and alg_Nmonte. # NB: we also keep track of the voxels through which tracks go that # just go through a single ROI, because we can (that's the *INDIMAP* # output). # As usual for pairwise connections, trimming of tracks is done # automatically-- the strands of tracks that aren't between two # targets get left off (if you really want, this setting can be turned # off, but probably that would be for very few cases...). NB: tracts # which only go through a single target ROI aren't trimmed, so one # still gets a 'broad' view of target-associated WM, anyways. For a # discussion of the '-dump_rois' option, see the 3dTrackID helpfile, # or the post-run reading, below. set uncfile = `\ls DTI/o.UNCERT*HEAD` time 3dTrackID -mode PROB \ -netrois ROI_ICMAP_GMI+orig \ -uncert "${uncfile[1]}" \ -dti_in DTI/DT \ -mask mask_DWI+orig \ -algopt ALGOPTS_PROB.dat \ -no_indipair_out \ -dump_rois AFNI \ -nifti \ -prefix DTI/o.PR \ -overwrite -echo_edu fat_proc_connec_vis \ -in_rois DTI/o.PR/NET_000_* \ -prefix DTI/o.PR_surfs \ -trackid_no_or cat <