Skip to content
Snippets Groups Projects
Commit c151a306 authored by Stephen Smith's avatar Stephen Smith
Browse files

*** empty log message ***

parent 4b536138
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ The order of <b>bvals</b> must match the order of <b>data.</b></li>
</ul>
<p><h4>Outputs of Bedpost</h4>
Bedpost creates a new directory at the same level as the input directory
called <indir>.bedpost which contains all the files you need for probabilistic
called &lt;indir&gt;.bedpost which contains all the files you need for probabilistic
tractography. Highlights are:
<ul>
......@@ -50,7 +50,10 @@ tractography. Highlights are:
<li><b>merged_phsamples</b> - Samples from the distribution on phi
</li><ul><li>theta and phi together represent the principal diffusion
direction in <a href="fdt_images/fdt_spherical_polars.gif">spherical polar co-ordinates</a></li></ul>
<li><b>merged_fsamples</b> - 4D volume - Samples from the distribution on anisotropic volume fraction (see <a href="http://www.fmrib.ox.ac.uk/analysis/techrep/tr03tb1/tr03tb1/">here</a>).</li>
<li><b>merged_fsamples</b> - 4D volume - Samples from the distribution
on anisotropic volume fraction (see <a
href="http://www.fmrib.ox.ac.uk/analysis/techrep/tr03tb1/tr03tb1/">technical
report</a>).</li>
<li><b>mean_thsamples</b> - 3D Volume - Mean of distribution on theta </li>
<li><b>mean_phsamples</b> - 3D Volume - Mean of distribution on phi </li>
<li><b>mean_fsamples</b> - 3D Volume - Mean of distribution on <i>f</i>
......@@ -64,6 +67,7 @@ from input directory</li>
<li><b>nodif_brain_mask</b> - binary mask created from nodif_brain -
copied from input directory
</li>
</ul>
<p><b>command line utility</b><br>
<p><h4>command line utility</h4>
<verb>bedpost &#60;indir&#62; </verb>
\ No newline at end of file
......@@ -2,8 +2,8 @@
<p><h3>Parallelising bedpost</h3> Bedpost runs Markov Chain Monte
Carlo sampling to build up distributions on diffusion parameters at
each voxel. This is a very slow process, so bedpost is very processor
hungry ( a typical bedpost run might take around 20hrs for 60
direction 2.5mm isotropic data)! However, fortunately bedpost
hungry (a typical bedpost run might take around 20hrs for 60
direction 2.5mm isotropic data!). However, fortunately bedpost
processes every voxel independently, so it is very easy to
parallelise.
......@@ -27,10 +27,11 @@ e.g. for a <code>bash </code> user:<br>
This will enable <code>bedpost</code> to use <code>ssh</code> to send jobs to two processors on <code>machine1</code>, and one each on <code>machine2 machine3 machine5</code>.<br><br>
You also need to make a file called <code>fsl.sh</code> in one of the following places.<br>
You also need to make a file called <code>fsl.sh</code>, on each
machine listed, in one of the following places.<br>
<code>/usr/local/etc/fslconf/fsl.sh</code><br>
<code>/etc/fslconf/fsl.sh</code><br>
<code>/${HOME}/.fslconf/fsl.sh</code><br><br>
<code>${HOME}/.fslconf/fsl.sh</code><br><br>
in this file you need to set your <code>FSLDIR</code> in <code>sh</code> language. e.g.:<br>
<code>FSLDIR=/usr/local/fsl</code><br>
......@@ -52,7 +53,7 @@ stands in the case of conflicts.
only one person can use bedpost at any one time (thus keeping the
system load down). In order to do this, set the
<code>FSLLOCKDIR</code> environment variable to a directory which is
writeable by the users. Every time a bedpost starts, it will write
writeable by all users. Every time a bedpost starts, it will write
<code>${FSLLOCKDIR}/.bedpost.lock</code> which will be removed when
bedpost completes. If this file is present, new bedpost processes will
not start.
......@@ -62,8 +63,8 @@ behaved in most circumstances. e.g. If bedpost is cancelled from the
keyboard, then it first logs onto all machines in the list and kills
its child processes, leaving no trace. However, there are some
circumstances where bedpost might not behave so well - e.g. if the
master machine (from where bedpost is called) crashes, I don't think
the processes on the other machines will crash. If this situation
master machine (from where bedpost is called) crashes, the processes
on the other machines will probably not be stopped. If this situation
occurs, there is a program called <code>bedpost_cleanup</code>, which
will kill all <code>bedpost</code> related processes owned by the user
on all machines in <code>$FSLMACHINELIST</code>.
......
......@@ -17,7 +17,7 @@ streamline location or the <em>connectivity distribution</em>.
using ProbTrack.
Probtrack can be run in several different modes:
<ul><li><a href="#path">Path Distribution Estimation</a></li>
<ul><li><a href="#path">Path distribution estimation</a></li>
<ul><li><a href="#single">Single seed voxel</a></li>
<li><a href="#seedmask">Seed mask</a></li>
<li><a href="#seedwaypoint">Seed mask and waypoint masks</a></li>
......@@ -36,7 +36,7 @@ specify a bedpost directory. For all modes, the bedpost directory must contain
<p>Results from probtrack can be binned in any available space -e.g.,
diffusion space, structural space or standard space. Note, however,
that tractography itself ALWAYS takes place in diffusion space - it is
simply the <em>results></em> of probtrack that are stored in the
simply the <em>results</em> of probtrack that are stored in the
required space. If probtrack results are to be stored in a space
other than diffusion space then you will need transformations from
this space back into the space of thediffusion data. The <a
......@@ -53,34 +53,33 @@ bedpost directory.
<li><b>xfms/standard2diff.mat</b></li>
<li><b>xfms/diff2standard.mat</b></li>
<h4><a href="#options">Options Tab</a></h4>
<hr>
<a name="path"></a>
<h3>Path Distribution Estimation - basics</h3>
The first four modes of ProbTrack involve generating connectivity
distributions from user-specified seed voxel(s). The output will be a single
image in the space of the specified seed like <a href="fdt_images/fdt_simple_tract3.gif"> this </a>. All
image in the space of the specified seed like <a href="fdt_images/fdt_simple_tract3.gif">this</a>. All
brain voxels will have a value (though many of these will be zero)
representing the connectivity value between that voxel and the seed voxel
(i.e., the number of samples that pass through that voxel). Note that when
connectivity distributions are generated from multiple seed voxel within a
connectivity distributions are generated from multiple seed voxels within a
region of interest then the time required for the analysis to run will be
approximately the number of seed voxels multiplied by the time taken to
generate a distrubiton from a single voxel.
generate a distribution from a single voxel.
<p><h4>Setting up the GUI for Path Distribution Estimation - settings common
to all modes:</h4>
<p><b>Seeds space:</b> specification of seeds is different for each mode - see below.
<p>If <b>seed space is not diffusion</b>, then check the button and
use the browse buttons to locate a reference image (e.g.,
subject1.bedpost/struct.hdr if seed space is structral space or
subject1.bedpost/standard.hdr if seed space is standard space) and the
transformation matrix from seed space to diffusion space (e.g.,
subject1.bedpost/xfms/str2diff.mat if seed space is structural space
or subject1.bedpost/xfms/standard2diff.mat if seed space is standard
<p>If <b>seed space is not diffusion</b>, then check this button. If
you are in <b>Single seed voxel</b> mode use the browse buttons to
locate a reference image (e.g., subject1.bedpost/struct.hdr if seed
space is structral space or subject1.bedpost/standard.hdr if seed
space is standard space). Next set the transformation matrix from seed
space to diffusion space (e.g., subject1.bedpost/xfms/str2diff.mat if
seed space is structural space or
subject1.bedpost/xfms/standard2diff.mat if seed space is standard
space). Note that, in all cases, the smaller the voxel size in your
seed space image, the lower will be the resulting connectivity values
to these voxels (This is intuitive - the smaller a voxel is, the less
......
......@@ -3,23 +3,23 @@
<p>If tractography results are to be stored in any space other than diffusion
space then registration must be run.
<p>Registration within Fdt uses <a href="http://www.fmrib.ox.ac.uk/fsl/flirt">flirt</a>. Registration can only be
<p>Registration within Fdt uses <a href="../flirt/index.html" target="_top">flirt</a>. Registration can only be
applied after Bedpost has been run. Typically, registration will be run
between three spaces:
<ul><li>Diffusion space (using the nodif_brain.{hdr,img} file stored in the Bedpost directory)</li>
<li>Structural space (using the struct.{hdr,img} file stored in the Bedpost
<ul><li>Diffusion space (using the nodif_brain image in the Bedpost directory)</li>
<li>Structural space (using the struct image in the Bedpost
directory, e.g., the space of a high resolution T1-weighted image of
the same subject)</li>
<li>Standard space (by default, the MNI152 brain stored within the fsldirectory).</li></ul>
<li>Standard space (by default, the MNI152 brain stored within $FSLDIR/etc/standard)</li></ul>
<p>Note that struct must have had bet applied. The nodif_brain image should be
<p>Note that struct must have had <a href="../bet/index.html" target="_top">bet</a> applied. The nodif_brain image should be
the brain extracted version of the nodif image that is automatically stored in
the Bedpost directory. The user will
have to manually apply bet to this image after running bedpost and before
running registration. (it is important that the user check the qualtiy of bet
results on these images and adjust the settings in bet where appropriate)
running registration. (it is important that the user check the quality of bet
results on these images and adjust the settings in bet where appropriate).
<p>Transformation matrices, and their inverses, will be dervied from diffusion to structural space and
<p>Transformation matrices, and their inverses, will be derived from diffusion to structural space and
from structural to standard space. Relevant matrices will be concatenated to
produce transformation matrices between diffusion and standard space. The resulting matrices are stored within
the 'xfms' subdirectory of the bedpost directory and named as follows:
......
......@@ -402,6 +402,7 @@ proc fdt:dialog { w tclstartupfile } {
-label "Main structural image" \
-labelwidth $LWIDTH \
-filterhist VARS(history)
set registration(struct_costfn) mutualinfo
set registration(struct_dof) 12
set registration(struct_search) 90
......@@ -1010,13 +1011,12 @@ proc fdt:apply { w dialog } {
}
# check output!=input
set canwite 1
if { $eddy(input) == $eddy(ouput) } {
set canwrite 1
if { $eddy(input) == $eddy(output) } {
set canwrite [ YesNoWidget "Output and input images have the same name. Overwrite input?" Yes No ]
}
if { $canwrite } {
puts "eddy_correct $eddy(input) $eddy(output) $eddy(refnum)"
catch { exec sh -c "eddy_correct $eddy(input) $eddy(output) $eddy(refnum)" } junk
fdt_monitor $w "${FSLDIR}/bin/eddy_correct $eddy(input) $eddy(output) $eddy(refnum)"
}
}
dtifit {
......@@ -1047,7 +1047,7 @@ proc fdt:apply { w dialog } {
set canwrite [ YesNoWidget "Overwrite $dtifit(output)?" Yes No ]
}
if { $canwrite } {
fdt_monitor $w "dtifit --data=$dtifit(input) --out=$dtifit(output) --mask=$dtifit(mask) --bvecs=$dtifit(bvecs) --bvals=$dtifit(bvals)"
fdt_monitor $w "${FSLDIR}/bin/dtifit --data=$dtifit(input) --out=$dtifit(output) --mask=$dtifit(mask) --bvecs=$dtifit(bvecs) --bvals=$dtifit(bvals)"
}
}
bedpost {
......@@ -1065,12 +1065,12 @@ proc fdt:apply { w dialog } {
set canwrite [ YesNoWidget "Overwrite ${bedpost(directory)}.bedpost?" Yes No ]
if { $canwrite } {
puts "rm -rf $bedpost(directory)"
exec rm -rf $bedpost(directory)
catch { exec rm -rf $bedpost(directory) } errmsg
}
}
if { $canwrite } {
puts "bedpost $bedpost(directory)"
fdt_monitor $w "bedpost $bedpost(directory)"
fdt_monitor $w "${FSLDIR}/bin/bedpost $bedpost(directory)"
}
}
probtrack {
......@@ -1394,25 +1394,25 @@ proc fdt:apply { w dialog } {
set searchry "-searchry -$registration(struct_search) $registration(struct_search)"
set searchrz "-searchrz -$registration(struct_search) $registration(struct_search)"
set options "$searchrx $searchry $searchrz -dof $registration(struct_dof)"
fdt_monitor $w "flirt -in $diff -ref $registration(struct_image) -omat $diff2str $options -cost $registration(struct_costfn)"
fdt_monitor $w "convert_xfm -omat $str2diff -inverse $diff2str"
fdt_monitor $w "${FSLDIR}/bin/flirt -in $diff -ref $registration(struct_image) -omat $diff2str $options -cost $registration(struct_costfn)"
fdt_monitor $w "${FSLDIR}/bin/convert_xfm -omat $str2diff -inverse $diff2str"
if { $registration(standard_yn) } {
set searchrx "-searchrx -$registration(standard_search) $registration(standard_search)"
set searchry "-searchry -$registration(standard_search) $registration(standard_search)"
set searchrz "-searchrz -$registration(standard_search) $registration(standard_search)"
set options "$searchrx $searchry $searchrz -dof $registration(standard_dof)"
fdt_monitor $w "flirt -in $registration(struct_image) -ref $registration(standard_image) -omat $str2stand $options -cost $registration(standard_costfn)"
fdt_monitor $w "convert_xfm -omat $stand2str -inverse $str2stand"
fdt_monitor $w "convert_xfm -omat $diff2stand -concat $str2stand $diff2str"
fdt_monitor $w "convert_xfm -omat $stand2diff -inverse $diff2stand"
fdt_monitor $w "${FSLDIR}/bin/flirt -in $registration(struct_image) -ref $registration(standard_image) -omat $str2stand $options -cost $registration(standard_costfn)"
fdt_monitor $w "${FSLDIR}/bin/convert_xfm -omat $stand2str -inverse $str2stand"
fdt_monitor $w "${FSLDIR}/bin/convert_xfm -omat $diff2stand -concat $str2stand $diff2str"
fdt_monitor $w "${FSLDIR}/bin/convert_xfm -omat $stand2diff -inverse $diff2stand"
}
} elseif { $registration(standard_yn) } {
set searchrx "-searchrx -$registration(standard_search) $registration(standard_search)"
set searchry "-searchry -$registration(standard_search) $registration(standard_search)"
set searchrz "-searchrz -$registration(standard_search) $registration(standard_search)"
set options "$searchrx $searchry $searchrz -dof $registration(standard_dof)"
fdt_monitor $w "flirt -in $diff -ref $registration(standard_image) -omat $diff2stand $options"
fdt_monitor $w "convert_xfm -omat $stand2diff -inverse $diff2stand"
fdt_monitor $w "${FSLDIR}/bin/flirt -in $diff -ref $registration(standard_image) -omat $diff2stand $options"
fdt_monitor $w "${FSLDIR}/bin/convert_xfm -omat $stand2diff -inverse $diff2stand"
}
puts "Done!"
# Fudge to make the logic work
......
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