Recent Changes - Search:

Homepage

This is the old Camino website, please visit our new page to download the code and get the latest documentation.









UCL MIG Home

UCL CS Home

UCL Home

edit SideBar

MultiFiberTrack

Tutorials.MultiFiberTrack History

Hide minor edits - Show changes to markup

June 25, 2010, at 01:43 PM by 128.16.14.149 -
Added lines 96-99:

You'll need to adapt some of the commands above for your data (specifically -voxeldims, -bgthresh and -size). You can find the script StringZeroPad in camino/SGE. convert is an ImageMagick command, which you may need to install.

Once that's all done, you can combine the results into a single file ready for tractography

Deleted lines 101-102:

You'll need to adapt some of the commands above for your data (specifically -voxeldims, -bgthresh and -size). You can find the script StringZeroPad in camino/SGE.

Changed lines 124-125 from:

I've used -snr 12, as the signal to noise of my unweighted images is around 12. Performance is reasonably robust to this setting so don't worry if the SNR varies over the image. Just pick a ball park correct figure.

to:

For my postmortem data set, I had to add -trace 8E-10, to specify a lower diffusivity for fixed tissue at room temperature than the default, which is meant for in-vivo tissue. I've removed it from the above so in-vivo users can cut and paste. I've used -snr 12, as the signal to noise of my unweighted images is around 12. Performance is reasonably robust to this setting so don't worry if the SNR varies over the image. Just pick a ball park correct figure.

Changed lines 130-131 from:

sflutgen -infofile ${DSID}_CalibData.info -outputstem ${DSID}_PAS${REID}_LUT -pdf watson < ${DSID}_CalibDataPAS${REID}_PDs.Bdouble

to:

sflutgen -infofile ${DSID}_CalibData.info -outputstem ${DSID}_PAS${REID}_LUT -pdf watson < ${DSID}_CalibDataPAS${REID}_PDs.Bdouble

Changed lines 151-152 from:

sfpeaks -inputmodel sh -order 6 -density 100 -searchradius 1.0 < ${DSID}_QBall.Bdouble > ${DSID}_QBallPDs.Bdouble

to:

sfpeaks -inputmodel sh -order 6 -density 100 -searchradius 1.0 < ${DSID}_QBall.Bdouble > ${DSID}_QBallPDs.Bdouble

Changed lines 161-163 from:

track -inputmodel pds -seedfile ../G140/MidSagCC -outputroot /tmp/G300_QBall6_MidSagCC -outputtracts oogl < ${DSID}_QBallPDs.Bdouble
geomview /tmp/G300_QBall6_MidSagCC1.oogl &

to:

track -inputmodel pds -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT}_QBall -outputtracts oogl < ${DSID}_QBallPDs.Bdouble
geomview ${DSID}_${SEEDFILEROOT}_QBall1.oogl &

Changed lines 174-176 from:

picopdfs -inputmodel pds -numpds 3 -pdf watson -luts ${DSID}_PAS${REID}_LUT_oneFibreLineCoeffs.Bdouble ${DSID}_PAS${REID}_LUT_twoFibreLineCoeffs.Bdouble ${DSID}_PAS${REID}_LUT_twoFibreLineCoeffs.Bdouble < PAS${REID}_${DSID}/PDs.Bdouble > PAS${REID}_${DSID}/PDsWatsonPDFs.Bdouble
track -inputmodel pico -pdf watson -numpds 3 -iterations 10 -seedfile ../G140/MidSagCC -outputroot /tmp/G300_PAS${REID}_MidSagCC_Watson10 -outputtracts oogl < PAS${REID}_${DSID}/PDsWatsonPDFs.Bdouble
geomview /tmp/G300_PAS${REID}_MidSagCC_Watson101.oogl &

to:

picopdfs -inputmodel pds -numpds 3 -pdf watson -luts ${DSID}_PAS${REID}_LUT_oneFibreLineCoeffs.Bdouble ${DSID}_PAS${REID}_LUT_twoFibreLineCoeffs.Bdouble ${DSID}_PAS${REID}_LUT_twoFibreLineCoeffs.Bdouble < ${DSID}_QBallPDs.Bdouble > ${DSID}_QBallPDsWatsonPDFs.Bdouble
track -inputmodel pico -pdf watson -numpds 3 -iterations 10 -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT}_QBall10 -outputtracts oogl < ${DSID}_QBallPDsWatsonPDFs.Bdouble
geomview ${DSID}_QBallPDsWatsonPDFs.Bdouble &

June 25, 2010, at 01:33 PM by 128.16.14.149 -
Changed line 42 from:

dtlutgen -schemefile $SCHEMEFILE -trace 8E-10 -snr 16.0 -inversion 1 > ${DSID}_DT_LUT.Bdouble

to:

dtlutgen -schemefile $SCHEMEFILE -trace 8E-10 -snr 16.0 -inversion 1 > ${DSID}_DT_LUT.Bdouble\\

Changed lines 58-65 from:

Now lets run reduced encoding (RE) PASMRI to recover PAS functions in each voxel. The following variable, RE, specifies the number of basis functions in the PAS representation. By default, it is the same as the number of gradient directions. The idea of RE-PASMRI is that we can use fewer basis functions, which speeds up the estimation of the PAS. The smaller the number, the quicker the reconstruction, but the more crude the representation. Here we'll try 3 levels of reduced encoding. In practice, you'll need to experiment a bit to pick a setting that recovers crossing fibres reliably and has manageable computation time. RE=5 is probably too low, but is a good setting to use as a first run to get the whole pipeline working, as PASMRI reconstruction is fast with this low setting. RE=16 we often find is a good setting with a good trade-off between accuracy and computation time. Worth comparing with a higher setting such as RE=30 though to see whether any significant improvement occurs.

#export RE=30; export REID=30; #export RE=16; export REID=16; export RE=5; export REID=05;

This directory will contain the output for each slice

to:

Now lets run reduced encoding (RE) PASMRI to recover PAS functions in each voxel. The following variable, RE, specifies the number of basis functions in the PAS representation. By default, the number of basis functions is the same as the number of gradient directions. The idea of RE-PASMRI is that we can use fewer basis functions, which speeds up the estimation of the PAS. The smaller the number, the quicker the reconstruction, but the more crude the representation. Here we'll try 3 levels of reduced encoding. In practice, you'll need to experiment a bit to pick a setting that recovers crossing fibres reliably and has manageable computation time. RE=5 is probably too low, but is a good setting to use as a first run to get the whole pipeline working, as PASMRI reconstruction is fast with this low setting. RE=16 we often find is a good setting with a good trade-off between accuracy and computation time. Worth comparing with a higher setting such as RE=30 though to see whether any significant improvement occurs.

#export RE=30; export REID=30;
#export RE=16; export REID=16;
export RE=5; export REID=05;
I'm going to run the reconstruction separately for each slice, which is useful for generating nice visualizations of the results using sfplot. This directory will contain the output for each slice

Changed lines 68-69 from:

If you only have one processor, use the following for loop:

to:

If you only have one processor, use the following for loop (or just run the whole file in one go):

Changed lines 72-73 from:

I happen to have 8, so I ran a separate process on each as follows:

to:

I happen to have 8, so I ran a separate process on each using the following set of 8 different for loops over the slices:

Changed line 84 from:

export SNUM=StringZeroPad $i 2`\\

to:

export SNUM=`StringZeroPad $i 2`\\

June 25, 2010, at 01:26 PM by 128.16.14.149 -
Changed lines 1-2 from:

This tutorial runs through deterministic and probabilistic tractography using multiple-fiber reconstructions like PASMRI and q-ball. I'll start with a data file of diffusion weighted measurements in Camino voxel-order format, called B0469.Bfloat, and corresponding schemefile, called B0469.scheme. The data set has 105 gradient directions and 25 b=0 images. Here are the stages we'll go through:

to:

This tutorial runs through deterministic and probabilistic tractography using multiple-fiber reconstructions like PASMRI and q-ball. I'll start with a data file of diffusion weighted measurements in Camino voxel-order format, called B4069.Bfloat, and corresponding schemefile, called B4069.scheme. The data set has 105 gradient directions with b value 4069s/mm^2 (it actually comes from a fixed brain) and 25 b=0 images. Here are the stages we'll go through:

Changed lines 11-12 from:

export DSID = 'B0469'
export SCHEMEFILE = 'B0469.scheme1'\\

to:

export DSID = 'B4069'
export SCHEMEFILE = 'B4069.scheme1'\\

Changed line 38 from:

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/DT_DetTracts.png \\

to:

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/DT_DetTracts.png

June 25, 2010, at 01:23 PM by 128.16.14.149 -
June 24, 2010, at 06:39 PM by 128.16.14.149 -
June 24, 2010, at 06:34 PM by 128.16.14.149 -
Added lines 141-175:

Q-ball reconstruction and tractography

Do the q-ball reconstruction using spherical harmonic representation up to order 6

qballmx -schemefile $SCHEMEFILE -basistype sh -order 6 > ${DSID}_QBALLMX.Bdouble
linrecon $DSID.Bfloat $SCHEMEFILE ${DSID}_QBALLMX.Bdouble -normalize -bgthresh 200 > ${DSID}_QBall.Bdouble
sfpeaks -inputmodel sh -order 6 -density 100 -searchradius 1.0 < ${DSID}_QBall.Bdouble > ${DSID}_QBallPDs.Bdouble
Note the sfpeaks command can take quite a while.

Check the directions are OK:

pdview -inputmodel pds -datadims ${XSIZE} ${YSIZE} ${ZSIZE} -scalarfile ${DSID}_FA.img < ${DSID}_QBallPDs.Bdouble

Do some deterministic tractography

track -inputmodel pds -seedfile ../G140/MidSagCC -outputroot /tmp/G300_QBall6_MidSagCC -outputtracts oogl < ${DSID}_QBallPDs.Bdouble
geomview /tmp/G300_QBall6_MidSagCC1.oogl &

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/QBall_DetTracts.png

Using the same calibration data set constructed above for PAS-PICo, calibrate for q-ball PICo

linrecon ${DSID}_CalibData.Bfloat $SCHEMEFILE ${DSID}_QBALLMX.Bdouble -normalize > ${DSID}_CalibDataQBall6.Bdouble
sfpeaks -inputmodel sh -order 6 -inputdatatype double -density 100 -searchradius 1.0 < ${DSID}_CalibDataQBall6.Bdouble > ${DSID}_CalibDataQBall6_PDs.Bdouble
sflutgen -infofile ${DSID}_CalibData.info -outputstem ${DSID}_QBall6_LUT -pdf watson < ${DSID}_CalibDataQBall6_PDs.Bdouble

Get the pdfs and run the tractography

picopdfs -inputmodel pds -numpds 3 -pdf watson -luts ${DSID}_PAS${REID}_LUT_oneFibreLineCoeffs.Bdouble ${DSID}_PAS${REID}_LUT_twoFibreLineCoeffs.Bdouble ${DSID}_PAS${REID}_LUT_twoFibreLineCoeffs.Bdouble < PAS${REID}_${DSID}/PDs.Bdouble > PAS${REID}_${DSID}/PDsWatsonPDFs.Bdouble
track -inputmodel pico -pdf watson -numpds 3 -iterations 10 -seedfile ../G140/MidSagCC -outputroot /tmp/G300_PAS${REID}_MidSagCC_Watson10 -outputtracts oogl < PAS${REID}_${DSID}/PDsWatsonPDFs.Bdouble
geomview /tmp/G300_PAS${REID}_MidSagCC_Watson101.oogl &

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/QBall_ProbTracts.png

June 24, 2010, at 06:29 PM by 128.16.14.149 -
Changed lines 113-120 from:

Here are results for RE=5

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS05_DetTracts.png
For comparison here's what I get for R=16 and R=30

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS16_DetTracts.png http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS30_DetTracts.png

to:

Here are results for RE=5, 16 and 30

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS05_DetTracts.png http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS16_DetTracts.png http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS30_DetTracts.png

Changed lines 137-139 from:

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS05_ProbTracts.png \\

to:

Results for R=5, 16 and 30 as before:

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS05_ProbTracts.png http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS16_ProbTracts.png http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS30_ProbTracts.png

June 24, 2010, at 06:15 PM by 128.16.14.149 -
Added lines 116-119:

For comparison here's what I get for R=16 and R=30

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS16_DetTracts.png http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS30_DetTracts.png \\

June 24, 2010, at 05:27 PM by 128.16.14.149 -
Changed line 134 from:

track -inputmodel pico -pdf watson -numpds 3 -iterations 10 -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT}_PAS${REID}10 -outputtracts oogl < PAS${REID}_${DSID}/PDsWatsonPDFs.Bdouble

to:

track -inputmodel pico -pdf watson -numpds 3 -iterations 10 -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT}_PAS${REID}10 -outputtracts oogl < PAS${REID}_${DSID}/PDsWatsonPDFs.Bdouble\\

Added lines 136-138:

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS05_ProbTracts.png

June 24, 2010, at 02:52 PM by 128.16.14.149 -
Changed lines 30-31 from:

track -inputmodel dt -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT} -outputtracts oogl < /tmp/${DSID}_DT.Bdouble

to:

track -inputmodel dt -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT}_DT -outputtracts oogl < /tmp/${DSID}_DT.Bdouble

Changed lines 34-35 from:

geomview /tmp/G300_DT_MidSagCC1.oogl &

to:

geomview ${DSID}_${SEEDFILEROOT}_DT1.oogl &

Changed lines 46-47 from:

track -inputmodel pico -seedfile $SEEDFILEROOT -iterations 10 -outputroot ${DSID}_${SEEDFILEROOT}10 -outputtracts oogl < ${DSID}_DT_PDFs.Bdouble

to:

track -inputmodel pico -seedfile $SEEDFILEROOT -iterations 10 -outputroot ${DSID}_${SEEDFILEROOT}_DT10 -outputtracts oogl < ${DSID}_DT_PDFs.Bdouble

Changed lines 50-51 from:

geomview ${DSID}_${SEEDFILEROOT}101.oogl &

to:

geomview ${DSID}_${SEEDFILEROOT}_DT101.oogl &

Changed lines 103-109 from:
  1. Check tractography is working
  2. This seems to work OK.

track -inputmodel pds -seedfile ../G140/MidSagCC -outputroot /tmp/G300_MidSagCC -outputtracts oogl < PAS${REID}_${DSID}/PDs.Bdouble geomview /tmp/G300_MidSagCC1.oogl &

to:

PAS Tractography

Deterministic tractography:

track -inputmodel pds -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT}_PAS${REID} -outputtracts oogl < PAS${REID}_${DSID}/PDs.Bdouble

For comparison with DT results

geomview ${DSID}_${SEEDFILEROOT}_PAS${REID}1.oogl &

Here are results for RE=5

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/PAS05_DetTracts.png
Now try some probabilistic tractography. Start by calibrating the pdf generator. This command creates a full size calibration data set (see sfpicocalibdata man page)

sfpicocalibdata -schemefile $SCHEMEFILE -snr 12 -infooutputfile ${DSID}_CalibData.info > ${DSID}_CalibData.Bfloat

I've used -snr 12, as the signal to noise of my unweighted images is around 12. Performance is reasonably robust to this setting so don't worry if the SNR varies over the image. Just pick a ball park correct figure.

Now do the actual calibration. This involves running RE-PAS on the calibration data set and constructing a look-up table. Over the full calibration data set, even RE-PAS can take a while. To get a quick set of results for a first pass, have a look at the sfpicocalibdata man page to see how you can reduce the size of the data set. You may find that you need to add arguments like -binincsize 2 -minvectsperbin 10 to sflutgen below to get it to work on smaller calibration data sets; check the sflutgen man page to see what they do. If you find you need such arguments for the full calibration data set, the calibration data set is not large enough. Anyway, here goes...

mesd -schemefile $SCHEMEFILE -filter PAS 1.4 -fastmesd -mepointset $RE < ${DSID}_CalibData.Bfloat > ${DSID}_CalibDataPAS${REID}.Bdouble
sfpeaks -schemefile $SCHEMEFILE -inputmodel maxent -filter PAS 1.4 -mepointset $RE -inputdatatype double < ${DSID}_CalibDataPAS${REID}.Bdouble > ${DSID}_CalibDataPAS${REID}_PDs.Bdouble
sflutgen -infofile ${DSID}_CalibData.info -outputstem ${DSID}_PAS${REID}_LUT -pdf watson < ${DSID}_CalibDataPAS${REID}_PDs.Bdouble
Note that the above uses a Watson model for the pdfs. You can also use Bingham; see sflutgen man page.

Now we can get the pdfs and do the tracking:

picopdfs -inputmodel pds -numpds 3 -pdf watson -luts ${DSID}_PAS${REID}_LUT_oneFibreLineCoeffs.Bdouble ${DSID}_PAS${REID}_LUT_twoFibreLineCoeffs.Bdouble ${DSID}_PAS${REID}_LUT_twoFibreLineCoeffs.Bdouble < PAS${REID}_${DSID}/PDs.Bdouble > PAS${REID}_${DSID}/PDsWatsonPDFs.Bdouble
track -inputmodel pico -pdf watson -numpds 3 -iterations 10 -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT}_PAS${REID}10 -outputtracts oogl < PAS${REID}_${DSID}/PDsWatsonPDFs.Bdouble geomview ${DSID}_${SEEDFILEROOT}_PAS${REID}101.oogl &

June 24, 2010, at 01:55 PM by 128.16.14.149 -
Changed lines 72-96 from:

for ((i=1; i<=${ZSIZE}; i=i+8)); do #for ((i=2; i<=${ZSIZE}; i=i+8)); do #for ((i=3; i<=${ZSIZE}; i=i+8)); do #for ((i=4; i<=${ZSIZE}; i=i+8)); do #for ((i=5; i<=${ZSIZE}; i=i+8)); do #for ((i=6; i<=${ZSIZE}; i=i+8)); do #for ((i=7; i<=${ZSIZE}; i=i+8)); do #for ((i=8; i<=${ZSIZE}; i=i+8)); do

echo $i

export SNUM=StringZeroPad $i 2` shredder $((${COMPONENTS}*${XSIZE}*${YSIZE}*(i-1)*4)) $((${COMPONENTS}*${XSIZE}*${YSIZE}*4)) $((${COMPONENTS}*${XSIZE}*${YSIZE}*${ZSIZE}*4)) < ${DSID}.Bfloat > /tmp/${DSID}_Slice${SNUM}.Bfloat dtfit /tmp/${DSID}_Slice${SNUM}.Bfloat $SCHEMEFILE | fa -outputdatatype float > /tmp/${DSID}_Slice${SNUM}_FA.img analyzeheader -datadims ${XSIZE} ${YSIZE} 1 -voxeldims 0.5 0.5 0.5 -datatype float > /tmp/${DSID}_Slice${SNUM}_FA.hdr

mesd -schemefile $SCHEMEFILE -filter PAS 1.4 -fastmesd -mepointset $RE -bgthresh 200 < /tmp/${DSID}_Slice${SNUM}.Bfloat > PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble sfpeaks -schemefile $SCHEMEFILE -inputmodel maxent -filter PAS 1.4 -mepointset $RE -inputdatatype double < PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble > PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}_PDs.Bdouble

sfplot -xsize ${YSIZE} -ysize ${XSIZE} -inputmodel maxent -filter PAS 1.4 -mepointset $RE -pointset 2 -minifigsize 30 30 -minifigseparation 2 2 -inputdatatype double -dircolcode -projection 1 2 < PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble > /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb convert -size 4096x4512 -depth 8 /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.png

rm /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb /tmp/${DSID}_Slice${SNUM}.Bfloat /tmp/${DSID}_Slice${SNUM}_FA.hdr /tmp/${DSID}_Slice${SNUM}_FA.img

@@done

to:

for ((i=1; i<=${ZSIZE}; i=i+8)); do
#for ((i=2; i<=${ZSIZE}; i=i+8)); do
#for ((i=3; i<=${ZSIZE}; i=i+8)); do
#for ((i=4; i<=${ZSIZE}; i=i+8)); do
#for ((i=5; i<=${ZSIZE}; i=i+8)); do
#for ((i=6; i<=${ZSIZE}; i=i+8)); do
#for ((i=7; i<=${ZSIZE}; i=i+8)); do
#for ((i=8; i<=${ZSIZE}; i=i+8)); do
echo $i
export SNUM=StringZeroPad $i 2`
shredder $((${COMPONENTS}*${XSIZE}*${YSIZE}*(i-1)*4)) $((${COMPONENTS}*${XSIZE}*${YSIZE}*4)) $((${COMPONENTS}*${XSIZE}*${YSIZE}*${ZSIZE}*4)) < ${DSID}.Bfloat > /tmp/${DSID}_Slice${SNUM}.Bfloat
dtfit /tmp/${DSID}_Slice${SNUM}.Bfloat $SCHEMEFILE | fa -outputdatatype float > /tmp/${DSID}_Slice${SNUM}_FA.img
analyzeheader -datadims ${XSIZE} ${YSIZE} 1 -voxeldims 0.5 0.5 0.5 -datatype float > /tmp/${DSID}_Slice${SNUM}_FA.hdr
mesd -schemefile $SCHEMEFILE -filter PAS 1.4 -fastmesd -mepointset $RE -bgthresh 200 < /tmp/${DSID}_Slice${SNUM}.Bfloat > PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble
sfpeaks -schemefile $SCHEMEFILE -inputmodel maxent -filter PAS 1.4 -mepointset $RE -inputdatatype double < PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble > PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}_PDs.Bdouble
sfplot -xsize ${YSIZE} -ysize ${XSIZE} -inputmodel maxent -filter PAS 1.4 -mepointset $RE -pointset 2 -minifigsize 30 30 -minifigseparation 2 2 -inputdatatype double -dircolcode -projection 1 2 < PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble > /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb
convert -size 4096x4512 -depth 8 /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.png
rm /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb /tmp/${DSID}_Slice${SNUM}.Bfloat /tmp/${DSID}_Slice${SNUM}_FA.hdr /tmp/${DSID}_Slice${SNUM}_FA.img
done

June 24, 2010, at 12:59 PM by 128.16.14.149 -
Changed line 1 from:

This tutorial runs through deterministic and probabilistic tractography using multiple-fiber reconstructions like PASMRI and q-ball. I'll start with a data file of diffusion weighted measurements in Camino voxel-order format, called X.Bfloat, and corresponding schemefile, called X.scheme. Here are the stages we'll go through:

to:

This tutorial runs through deterministic and probabilistic tractography using multiple-fiber reconstructions like PASMRI and q-ball. I'll start with a data file of diffusion weighted measurements in Camino voxel-order format, called B0469.Bfloat, and corresponding schemefile, called B0469.scheme. The data set has 105 gradient directions and 25 b=0 images. Here are the stages we'll go through:

Added line 15:

export COMPONENTS=130\\

Added lines 52-112:

Reduced-encoding PASMRI

Now lets run reduced encoding (RE) PASMRI to recover PAS functions in each voxel. The following variable, RE, specifies the number of basis functions in the PAS representation. By default, it is the same as the number of gradient directions. The idea of RE-PASMRI is that we can use fewer basis functions, which speeds up the estimation of the PAS. The smaller the number, the quicker the reconstruction, but the more crude the representation. Here we'll try 3 levels of reduced encoding. In practice, you'll need to experiment a bit to pick a setting that recovers crossing fibres reliably and has manageable computation time. RE=5 is probably too low, but is a good setting to use as a first run to get the whole pipeline working, as PASMRI reconstruction is fast with this low setting. RE=16 we often find is a good setting with a good trade-off between accuracy and computation time. Worth comparing with a higher setting such as RE=30 though to see whether any significant improvement occurs.

#export RE=30; export REID=30; #export RE=16; export REID=16; export RE=5; export REID=05;

This directory will contain the output for each slice

mkdir PAS${REID}_${DSID}

If you only have one processor, use the following for loop:

for ((i=1; i<=${ZSIZE}; i=i+1)); do

I happen to have 8, so I ran a separate process on each as follows:

for ((i=1; i<=${ZSIZE}; i=i+8)); do #for ((i=2; i<=${ZSIZE}; i=i+8)); do #for ((i=3; i<=${ZSIZE}; i=i+8)); do #for ((i=4; i<=${ZSIZE}; i=i+8)); do #for ((i=5; i<=${ZSIZE}; i=i+8)); do #for ((i=6; i<=${ZSIZE}; i=i+8)); do #for ((i=7; i<=${ZSIZE}; i=i+8)); do #for ((i=8; i<=${ZSIZE}; i=i+8)); do

echo $i

export SNUM=StringZeroPad $i 2` shredder $((${COMPONENTS}*${XSIZE}*${YSIZE}*(i-1)*4)) $((${COMPONENTS}*${XSIZE}*${YSIZE}*4)) $((${COMPONENTS}*${XSIZE}*${YSIZE}*${ZSIZE}*4)) < ${DSID}.Bfloat > /tmp/${DSID}_Slice${SNUM}.Bfloat dtfit /tmp/${DSID}_Slice${SNUM}.Bfloat $SCHEMEFILE | fa -outputdatatype float > /tmp/${DSID}_Slice${SNUM}_FA.img analyzeheader -datadims ${XSIZE} ${YSIZE} 1 -voxeldims 0.5 0.5 0.5 -datatype float > /tmp/${DSID}_Slice${SNUM}_FA.hdr

mesd -schemefile $SCHEMEFILE -filter PAS 1.4 -fastmesd -mepointset $RE -bgthresh 200 < /tmp/${DSID}_Slice${SNUM}.Bfloat > PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble sfpeaks -schemefile $SCHEMEFILE -inputmodel maxent -filter PAS 1.4 -mepointset $RE -inputdatatype double < PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble > PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}_PDs.Bdouble

sfplot -xsize ${YSIZE} -ysize ${XSIZE} -inputmodel maxent -filter PAS 1.4 -mepointset $RE -pointset 2 -minifigsize 30 30 -minifigseparation 2 2 -inputdatatype double -dircolcode -projection 1 2 < PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.Bdouble > /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb convert -size 4096x4512 -depth 8 /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb PAS${REID}_${DSID}/${DSID}_Slice${SNUM}_PAS${REID}.png

rm /tmp/${DSID}_Slice${SNUM}_PAS${REID}.rgb /tmp/${DSID}_Slice${SNUM}.Bfloat /tmp/${DSID}_Slice${SNUM}_FA.hdr /tmp/${DSID}_Slice${SNUM}_FA.img

@@done

cat PAS${REID}_${DSID}/*PAS${REID}_PDs.Bdouble > PAS${REID}_${DSID}/PDs.Bdouble

You'll need to adapt some of the commands above for your data (specifically -voxeldims, -bgthresh and -size). You can find the script StringZeroPad in camino/SGE.

Now you can check that principal directions of the PAS functions:

pdview -inputmodel pds -datadims ${XSIZE} ${YSIZE} ${ZSIZE} -scalarfile ${DSID}_FA.img < PAS${REID}_${DSID}/PDs.Bdouble

  1. Check tractography is working
  2. This seems to work OK.

track -inputmodel pds -seedfile ../G140/MidSagCC -outputroot /tmp/G300_MidSagCC -outputtracts oogl < PAS${REID}_${DSID}/PDs.Bdouble geomview /tmp/G300_MidSagCC1.oogl &

June 24, 2010, at 12:13 PM by 128.16.14.149 -
Changed line 3 from:
  • PAS reconstruction using reduced encoding PASMRI.
to:
  • PAS reconstruction using reduced encoding PASMRI (see Sweet and Alexander ISMRM 2010).
Changed lines 36-37 from:
to:

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/DT_DetTracts.png

Added line 50:

http://www.cs.ucl.ac.uk/research/medic/camino/tutorials/files/mfrtrack/DT_ProbTracts.png \\

June 24, 2010, at 11:45 AM by 128.16.14.149 -
Changed lines 8-9 from:

DTI Tractography

to:

Define some variables used throughout, which are specific to my data set:
export DSID = 'B0469'
export SCHEMEFILE = 'B0469.scheme1'
export XSIZE = 128
export YSIZE = 141
export YSIZE = 30
export SEEDFILEROOT = 'MidSagCC'

DTI Tractography

Added lines 24-48:

dtfit ${DSID}.Bfloat $SCHEMEFILE > /tmp/${DSID}_DT.Bdouble
dteig < /tmp/${DSID}_DT.Bdouble | pdview -datadims $XSIZE $YSIZE $ZSIZE

Run deterministic tractography from a seed region (mine is the midsagittal corpus callosum)

track -inputmodel dt -seedfile $SEEDFILEROOT -outputroot ${DSID}_${SEEDFILEROOT} -outputtracts oogl < /tmp/${DSID}_DT.Bdouble

Display the tracts

geomview /tmp/G300_DT_MidSagCC1.oogl &

Here's what we get

Now run some probabilistic tractography. Start by generating the look up table and create the pdfs in each voxel

dtlutgen -schemefile $SCHEMEFILE -trace 8E-10 -snr 16.0 -inversion 1 > ${DSID}_DT_LUT.Bdouble cat /tmp/${DSID}_DT.Bdouble | picopdfs -inputmodel dt -luts ${DSID}_DT_LUT.Bdouble > ${DSID}_DT_PDFs.Bdouble

Now do the tracking (you may want to increase the number of iterations in a real application)

track -inputmodel pico -seedfile $SEEDFILEROOT -iterations 10 -outputroot ${DSID}_${SEEDFILEROOT}10 -outputtracts oogl < ${DSID}_DT_PDFs.Bdouble

And display the results for comparison

geomview ${DSID}_${SEEDFILEROOT}101.oogl &

June 24, 2010, at 11:32 AM by 128.16.14.149 -
Added lines 1-13:

This tutorial runs through deterministic and probabilistic tractography using multiple-fiber reconstructions like PASMRI and q-ball. I'll start with a data file of diffusion weighted measurements in Camino voxel-order format, called X.Bfloat, and corresponding schemefile, called X.scheme. Here are the stages we'll go through:

  • Deterministic and probabilistic DTI tractography as a baseline
  • PAS reconstruction using reduced encoding PASMRI.
  • Deterministic tractography using PASMRI
  • Probabilistic tractography using PASMRI
  • q-ball reconstruction and tractography for comparison

DTI Tractography

This is covered in detail in other tutorials, so I'll keep it brief.

Fit the diffusion tensor and check that the tensor orientations correspond with the image orientation:

Edit - History - Print - Recent Changes - Search
Page last modified on June 25, 2010, at 01:43 PM