TRACULA is a fiber tracking and white matter segmentation tool within FreeSurfer.
Running TRACULA
- Required data
- Copy to local SUBJECTS_DIR
- Edit dmrirc
- Run processing
- View results
Table of Contents | ||
---|---|---|
|
Required data
T1 with FreeSurfer processing
...
The bvals and bvecs files that TRACULA needs are slightly different to those used by FSL, so new files need to be created. The difference is that FSL has data across columns/volume, whereas TRACULA requires rows/volume, so they simply need to be flipped. One way to do this is as follows:
- Find the bvals file (e.g., V:\LinuxShare\subjects4FSL\CON302\DTI_b0corr\bvals) and open it in Excel
- Open Excel
- File => Open (or Ctrl^O)
- Change type to "All Files"
- Select bvals, click Open
- In the Text Import Wizard
- Step 1 choose "Delimited" (click Next)
- Step 2 check "Space" (click Finish)
- The values will appear as one row. Select the row of values, and Copy
- Go to an empty cell (next row down)
A configuration file is used to define subjects and locations.
The following commands are examples of running the preprocessing steps:
Background Color |
---|
|
Here is an example of how to do that.
Copy to local SUBJECTS_DIR
1) In Linux, check that you have a folder
/usr/local/freesurfer/subjects
If not, create it. This will also need the bert and fsaverage folders copied to it.
2) copy the T1 FreeSurfer subject to this folder. An example of a command (from a terminal in Linux):
...]$ cp -rv /mnt/hgfs/LinuxShare/subjects4freesurfer/CON302 /usr/local/freesurfer/subjects
Note the format of specifying the folder to copy, and the folder to copy into (as opposed to the destination folder); thus in the above example, the destination does not include "CON302".
3) Copy the DTI data to the same subjects folder:
Create the folder if it does not already exist:
...]$ mkdir /usr/local/freesurfer/subjects/CON302/DTI_b0corr
Copy the main data file:
...]$ cp /mnt/hgfs/LinuxShare/subjects4FSL/CON302/DTI_b0corr/data.ni* /usr/local/freesurfer/subjects/CON302/DTI_b0corr
Copy bvals4tracula.txt and bvecs4tracula.txt (see above to create them):
...]$ cp /mnt/hgfs/LinuxShare/subjects4FSL/CON302/DTI_b0corr/*4tracula.txt /usr/local/freesurfer/subjects/CON302/DTI_b0corr
Configuration File (dmrirc)
This is a required file which is passed to the TRACULA processing steps. Every new analysis requires a new or modified dmrirc file. If more than one person is analyzing the same datasest, best practice is to save each analysis as a unique file. A reasonable place to save this files is LinuxShare\tracula.
FreeSurfer Preprocessing
Make sure each subject has a successfully completed FreeSurfer preprocessing set of filesOnce you have a basic file, the most common change will be the subject name.
Run TRACULA preprocessing
There are three commands to the preprocessing. Each command uses the dmrirc file, so in the samples below, you would change the "-c" parameter to the file you created.
trac-all -prep -c /mnt/hgfs/LinuxShare/tracula/dmrirc_VM.txt
trac-all -bedp -c /mnt/hgfs/LinuxShare/tracula/dmrirc_VM.txt
trac-all -path -c /mnt/hgfs/LinuxShare/tracula/dmrirc_VM.txt
These can be combined into one command, to run all three steps at once, by separating with "&&". (Separating with ";" semicolons will run all three commands indepedently, whereas "&&" will stop if the first command fails, which is what we want.) Thus the most command command will be:
...]$ trac-all -prep -c /mnt/hgfs/LinuxShare/tracula/dmrirc_VM.txt && trac-all -bedp -c /mnt/hgfs/LinuxShare/tracula/dmrirc_VM.txt && trac-all -path -c /mnt/hgfs/LinuxShare/tracula/dmrirc_VM.txt
Viewing Paths
The TRACULA portion of the wiki has several examples of the commands you will need to type. You need to adjust the location of the files.
Example to view single track:
...]$ freeview -v /usr/local/freesurfer/subjects/CON302/dmri/dtifit_FA.nii.gz /usr/local/freesurfer/subjects/CON302/dpath/lh.ilf_AS_avg33_mni_bbr/path.pd.nii.gz:colormap=jet:isosurface=0,0:color='Red'
Example to view all tracks:
...]$ freeview -v /usr/local/freesurfer/subjects/CON302/dmri/dtifit_FA.nii.gz -tv /usr/local/freesurfer/subjects/CON302/dpath/merged_avg33_mni_bbr.mgz
Saving Outputs
You will want to copy the results back to the LinuxShare. All TRACULA outputs are in the subject "dmri" and "dpath" subfolders:
...]$ cp -rv /usr/local/freesurfer/subjects/CON302/dmri* /mnt/hgfs/LinuxShare/subjects4freesurfer/CON302
...]$ cp -rv /usr/local/freesurfer/subjects/CON302/dpath /mnt/hgfs/LinuxShare/subjects4freesurfer/CON302
The results will be available to everyone. Viewing paths and measure stats will require adjusting the file location.
DTI Data
Probably easiest to use an outside folder; if DICOM files are available, these will work (at least for Siemens scanners). Otherwise, the format is akin to FSL.
- Note that for Linux, spaces are a problem, so the file names must have spaces removed.
Technical Note: Issues running in a VM*
The scripts rely on symbolic links, which cannot be created on Windows shared folders. Thus, the SUBJECTS_DIR must be local, and under the usual VM setup we use, the files need to be copied locally, and the local SUBJECTS_DIR set.
...