Skip to content
Snippets Groups Projects
Commit 792ca5d0 authored by Saad Jbabdi's avatar Saad Jbabdi
Browse files

freesurfer tracking

parent 00cee888
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<HTML><HEAD><meta http-equiv="Content-Type" <HTML><HEAD><meta http-equiv="Content-Type"
content="text/html;charset=utf-8"> content="text/html;charset=utf-8">
<link REL="stylesheet" TYPE="text/css" <link REL="stylesheet" TYPE="text/css"
href="../.fsl/fsl.css"><TITLE>FSL</TITLE></HEAD> href="../fsl.css"><TITLE>FSL</TITLE></HEAD>
<BODY><IFRAME width="100%" scrolling="no" frameborder="0" src="fdt_top.html">Broken</IFRAME> <BODY><IFRAME width="100%" scrolling="no" frameborder="0" src="fdt_top.html">Broken</IFRAME>
<h3>Running probtrackx from freesurfer cortical surfaces</h3> <h3>Running probtrackx from freesurfer cortical surfaces</h3>
...@@ -76,38 +76,44 @@ flirt -in myroi -ref $SUBJECTS_DIR/john/mri/nifti/brain -out myconformedroi -app ...@@ -76,38 +76,44 @@ flirt -in myroi -ref $SUBJECTS_DIR/john/mri/nifti/brain -out myconformedroi -app
The next thing to do is to project this ROI into a FreeSurfer surface. We recommend using the grey/white interface to seed tractography from the cortex: (assuming the ROI is in the left hemisphere)<br><br> The next thing to do is to project this ROI into a FreeSurfer surface. We recommend using the grey/white interface to seed tractography from the cortex: (assuming the ROI is in the left hemisphere)<br><br>
<code> <code>
printf "john\n1\n1\n1\n1 0 0 0\n0 1 0 0\n0 0 1 0\n0 0 0 1\n" > reg.dat <br> printf "john\n1\n1\n1\n1 0 0 0\n0 1 0 0\n0 0 1 0\n0 0 0 1\n" > reg.dat <br>
mri_vol2surf --src myconformedroi --srcreg reg.dat --projfrac 0.5 --hemi lh --out myroi2surf.mgh <br> mri_vol2surf --src myconformedroi.nii.gz --srcreg reg.dat --projfrac 0.5 --hemi lh --out myroi2surf.mgh <br>
mri_binarize --i myroi2surf.mgh --min 0.5 --o myroi2surf.mgh <br> mri_binarize --i myroi2surf.mgh --min 0.5 --o myroi2surf.mgh <br>
mri_cor2label --i myroi2surf.mgh --surf john lh white --id 1 --l myroilabel <br> mri_cor2label --i myroi2surf.mgh --surf john lh white --id 1 --l ./myroilabel <br>
</code> </code>
<br> <br>
This will create a file called <code>myroilabel.label</code> that you can use directly in probtrackx (see following section). This will create a file called <code>myroilabel.label</code> that you can use directly in probtrackx (see following section). We recommend checking the label file by loading it onto a freesurfer surface using tksurfer. E.g.:
<br><br>
<code>
tksurfer john lh white
</code>
<br><br>Then File->Label->Load labels
<br><br>
<h4>3. Running probtrackx using surfaces</h4> <h4>3. Running probtrackx using surfaces</h4>
All you need to do now, is to run probtrackx specifying four things: (1) the label file as a seed, (2) a description of the whole cortical surface for the corresponding hemisphere [e.g. surf.white.asc], (3) provide a transformation from conformed FreeSurfer space to diffusion space, and (4) a conformed FreeSurfer volume as a reference space: All you need to do now, is to run probtrackx specifying four things: (1) the label file as a seed, (2) a description of the whole cortical surface for the corresponding hemisphere [e.g. surf.white.asc], (3) provide a transformation from conformed FreeSurfer space to diffusion space, and (4) a conformed FreeSurfer volume as a reference space:
<br><br> <br><br>
<code> <code>
probtrackx -x myroilabel.label --mesh=$SUBJECTS_DIR/john/surf/lh.white.asc --xfm=freesurfer2fa.mat --ref=$SUBJECTS_DIR/john/mri/nifti/brain [+all the other options] probtrackx -x myroilabel.label --mesh=$SUBJECTS_DIR/john/surf/lh.white.asc --xfm=freesurfer2fa.mat --seedref=$SUBJECTS_DIR/john/mri/nifti/brain [+all the other options]
</code> </code>
<br><br> <br><br>
You can also run probtrackx using a nonlinear warpfield to get from freesurfer space to diffusion space (if you had used FNIRT in step 1 above):<br><br> You can also run probtrackx using a nonlinear warpfield to get from freesurfer space to diffusion space (if you had used FNIRT in step 1 above):<br><br>
<code> <code>
probtrackx -x myroilabel.label --mesh=$SUBJECTS_DIR/john/surf/lh.white.asc --xfm=freesurfer2fa_warp --invxfm=fa2freesurfer_warp --ref=$SUBJECTS_DIR/john/mri/nifti/brain [+all the other options] probtrackx -x myroilabel.label --mesh=$SUBJECTS_DIR/john/surf/lh.white.asc --xfm=freesurfer2fa_warp --invxfm=fa2freesurfer_warp --seedref=$SUBJECTS_DIR/john/mri/nifti/brain [+all the other options]
</code> </code>
<br><br> <br><br>
Note: in this last case, we need both forward and backward transforms fa<-->freesurfer. Note: in this last case, we need both forward and backward transforms fa<-->freesurfer.
<h4>4. Using some of the outputs</h4> <h4>4. Using some of the outputs</h4>
When using classification targets in probtrackx, together with a surface-based seed, an output is created in the form of a matrix called matrix_seeds_to_all_targets. You can use this file to run find_the_biggest and produce label files for each of the hard-classified clusters. You can also use it to produce overlay files containing connectivity scores to each target.<br><br> When using classification targets in probtrackx, together with a surface-based seed, you may use the probtrackx option <code>--seedcountastext</code>, in which case an output is created in the form of a matrix called matrix_seeds_to_all_targets. You can use this file to run find_the_biggest and produce label files for each of the hard-classified clusters. You can also use it to produce overlay files containing connectivity scores to each target.<br><br>
Running find_the_biggest using matrix_seeds_to_all_targets:<br><br> Running find_the_biggest using matrix_seeds_to_all_targets:<br><br>
<code> <code>
find_the_biggest matrix_seeds_to_all_targets myroilabel.label myclusters find_the_biggest matrix_seeds_to_all_targets myroilabel.label myclusters
</code> </code>
<br><br> <br><br>
The output of this command will be a set of files called myclusters<i>.label, i.e. one label file per cluster. You can combine these to produce a single annotation file: The output of this command will be a set of files called myclusters&lt;i&gt;.label, i.e. one label file per cluster. You can combine these to produce a single annotation file:
<br><br> <br><br>
<code> <code>
mris_label2annot --s john --h lh --ctab $FSLDIR/etc/luts/fsrandlut.txt --a myannot --l myclusters_1.label --l myclusters_2.label [etc.] mris_label2annot --s john --h lh --ctab $FSLDIR/etc/luts/fsrandlut.txt --a myannot `ls myclusters_*.label | awk '{print "--l " $1}'`
</code> </code>
<br><br> <br><br>
Once this is done, you can load the result myannot.annot onto tksurfer. Just type:<br><br> Once this is done, you can load the result myannot.annot onto tksurfer. Just type:<br><br>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment