MRtrix

From VISTA LAB WIKI

(Difference between revisions)
Jump to: navigation, search
(Created page with "MRtrix is a set of tools to perform diffusion-weighted MR white-matter tractography in a manner robust to crossing fibers, using constrained spherical deconvolution (CSD) and pro...")
 
Line 1: Line 1:
-
MRtrix is a set of tools to perform diffusion-weighted MR white-matter tractography in a manner robust to crossing fibers, using constrained spherical deconvolution (CSD) and probabilistic streamlines. This page describes how to install and use this package with our Fedora machines and data in the VISTA laboratory.  
+
MRtrix is a set of tools to perform diffusion-weighted MR white-matter tractography in a manner robust to crossing fibers, using constrained spherical deconvolution (CSD) and probabilistic streamlines. This page describes how to install and use this package with our Fedora machines and data in the VISTA laboratory.  
-
Elsewhere, we describe how [[MRTrix_examples | to run MRtrix]] on local data.
+
Elsewhere, we describe how [[MRTrix examples|to run MRtrix]] on local data.  
-
We often use MRtrix along with the [http://white.stanford.edu/~brian/papers/mri/2014-Life-Pestilli-Wandell.pdf Linear Fascicle Evaluation (LiFE) technology]. We describe how to run [[LiFE | LiFE on a separate page]] .
+
We often use MRtrix along with the [http://white.stanford.edu/~brian/papers/mri/2014-Life-Pestilli-Wandell.pdf Linear Fascicle Evaluation (LiFE) technology]. We describe how to run [[LiFE|LiFE on a separate page]] .  
-
= Install MRtrix =  
+
= Install MRtrix =
If you are running Ubuntu, mrtrix is part of the neurodebian command set. You should check to see that the [http://neuro.debian.net/# neurodebian repo] is installed, and then use that to install the mrtrix package.  
If you are running Ubuntu, mrtrix is part of the neurodebian command set. You should check to see that the [http://neuro.debian.net/# neurodebian repo] is installed, and then use that to install the mrtrix package.  
-
[[MRtrix]] can also be downloaded from [https://www.nitrc.org/projects/mrtrix/ this site].
+
[[MRtrix]] can also be downloaded from [https://www.nitrc.org/projects/mrtrix/ this site].  
-
There is a github repository for the [https://github.com/jdtournier/mrtrix3 developmental versions].
+
There is a github repository for the [https://github.com/jdtournier/mrtrix3 developmental versions].  
-
See Michael Perry about dockerization.
+
See Michael Perry about dockerization.  
'''VistaLab users''' can simply add the MRtrix direcotry to their bash path in bashrc.  
'''VistaLab users''' can simply add the MRtrix direcotry to their bash path in bashrc.  
   # For MRTRIX  
   # For MRTRIX  
-
  if [ "$(hostname)" == "azure.stanford.edu" ]; then
+
if [ "$(hostname)" == "azure.stanford.edu" ]; then
-
      export PATH=/white/local/mrtrix/v0.2.7/bin:$PATH
+
    export PATH=/white/local/mrtrix/v0.2.7/bin:$PATH
-
      export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.7/lib:$LD_LIBRARY_PATH
+
    export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.7/lib:$LD_LIBRARY_PATH
-
  elif [ "$(hostname)" == "peach.stanford.edu" ]; then
+
elif [ "$(hostname)" == "peach.stanford.edu" ]; then
-
      export PATH=/white/local/mrtrix/v0.2.10/bin:$PATH
+
    export PATH=/white/local/mrtrix/v0.2.10/bin:$PATH
-
      export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.10/lib:$LD_LIBRARY_PATH
+
    export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.10/lib:$LD_LIBRARY_PATH
-
  else
+
else
-
      export PATH=/usr/lib/mrtrix/bin:$PATH
+
    export PATH=/usr/lib/mrtrix/bin:$PATH
-
  fi
+
fi
-
* Note that azure will only run v2.7 while peach runs v2.10. All other machines run the up-to-date Neurodebian version.  
+
*Note that azure will only run v2.7 while peach runs v2.10. All other machines run the up-to-date Neurodebian version.
 +
 
 +
*''If you're using Fedora 12 use the following line instead of the one just above''
-
* ''If you're using Fedora 12 use the following line instead of the one just above''
 
   export PATH=/white/local/mrtrix/v0.2.10_fc12/bin:$PATH
   export PATH=/white/local/mrtrix/v0.2.10_fc12/bin:$PATH
-
  export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.10_fc12/lib/
+
  export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.10_fc12/lib/
-
= Build MRtrix =
+
= Build MRtrix =
-
If you would prefer to download/build/configure the ''latest'' version of MRtrix for your machine, keep reading...
+
-
'''Download:''': The tar-ball can be downloaded from [http://www.nitrc.org/projects/mrtrix/ NITRC].
+
If you would prefer to download/build/configure the ''latest'' version of MRtrix for your machine, keep reading...  
-
* If you are lucky enough to be running Ubuntu, you can simply install the [http://neuro.debian.net/# neurodebian repo] and install the mrtrix package through that.
+
'''Download:''': The tar-ball can be downloaded from [http://www.nitrc.org/projects/mrtrix/ NITRC].  
-
* There is a WINDOWS exe, which you can download from [http://www.nitrc.org/projects/mrtrix/ NITRC].
+
-
'''Install required Libs''': Before you can build the program for linux you need to install some libraries:
+
*If you are lucky enough to be running Ubuntu, you can simply install the [http://neuro.debian.net/# neurodebian repo] and install the mrtrix package through that.
-
<ol>
+
*There is a WINDOWS exe, which you can download from [http://www.nitrc.org/projects/mrtrix/ NITRC].
-
* g++ - the GNU C++ compiler (version > 4.0.0 recommended)
+
 
-
* python (version > 2.5 recommended)
+
'''Install required Libs''': Before you can build the program for linux you need to install some libraries:  
-
* glib (version > 2.16)
+
 
-
* gtk+ (version > 2.12)
+
*g++ - the GNU C++ compiler (version &gt; 4.0.0 recommended)  
-
* glibmm (version > 2.16)
+
*python (version &gt; 2.5 recommended)  
-
* gtkmm (version > 2.12)
+
*glib (version &gt; 2.16)  
-
* gtkglext (version > 1.0)
+
*gtk+ (version &gt; 2.12)  
-
* GSL (GNU Scientific Library; version > 1.8)
+
*glibmm (version &gt; 2.16)  
-
* OpenGL implementation (version > 1.2)
+
*gtkmm (version &gt; 2.12)  
-
</ol>
+
*gtkglext (version &gt; 1.0)  
 +
*GSL (GNU Scientific Library; version &gt; 1.8)  
 +
*OpenGL implementation (version &gt; 1.2)  
 +
 
 +
On 64-bit Fedora you can install these packages using the following command (if you don't have sudo on your machine, find someone who does):
-
On 64-bit Fedora you can install these packages using the following command (if you don't have sudo on your machine, find someone who does):
 
   sudo yum install glibmm24.x86_64 gtkmm24.x86_64 glib.x86_64 glib2-devel.x86_64 glib2.x86_64 gtkmm-utils.x86_64 gtkmm24-devel.x86_64 gtkglext-devel.x86_64 gtkglext-libs.x86_64 gtkglextmm-devel.x86_64 gtkglextmm.x86_64 gsl-devel.x86_64 gsl.x86_64 compat-libstdc++-33.x86_64 libstdc++-devel.x86_64 libstdc++.x86_64
   sudo yum install glibmm24.x86_64 gtkmm24.x86_64 glib.x86_64 glib2-devel.x86_64 glib2.x86_64 gtkmm-utils.x86_64 gtkmm24-devel.x86_64 gtkglext-devel.x86_64 gtkglext-libs.x86_64 gtkglextmm-devel.x86_64 gtkglextmm.x86_64 gsl-devel.x86_64 gsl.x86_64 compat-libstdc++-33.x86_64 libstdc++-devel.x86_64 libstdc++.x86_64
-
'''Build'''
+
'''Build'''  
Unpack archive and compile:  
Unpack archive and compile:  
     tar xjf mrtrix-0.2.9.tar.bz2
     tar xjf mrtrix-0.2.9.tar.bz2
-
    cd mrtrix-0.2.9/
+
  cd mrtrix-0.2.9/
-
    ./build
+
  ./build
-
'''Set the Path in .bashrc''':
+
'''Set the Path in .bashrc''':  
-
Set appropriate environment variables:
+
Set appropriate environment variables:  
-
Bash shell:
+
Bash shell:  
-
    export PATH=/<edit as appropriate>/mrtrix-0.2.9/bin:$PATH
+
-
    export LD_LIBRARY_PATH=/<edit as appropriate>/mrtrix-0.2.9/lib
+
-
C shell:
+
     export PATH=/&lt;edit as appropriate&gt;/mrtrix-0.2.9/bin:$PATH
-
     setenv PATH /<edit as appropriate>/mrtrix-0.2.9/bin:$PATH
+
  export LD_LIBRARY_PATH=/&lt;edit as appropriate&gt;/mrtrix-0.2.9/lib
-
    setenv LD_LIBRARY_PATH /<edit as appropriate>/mrtrix-0.2.9/lib
+
-
* ''Note:'' You have to open a new shell before these changes will take effect.
+
-
= Enable Multi-Threading =
+
C shell:
-
By default MRtrix will read a configuration file for additional options. Among those options is Multi-Threading. <br> The configuration file (.mrtrix.conf) should be stored in your home directory. <br>
+
    setenv PATH /&lt;edit as appropriate&gt;/mrtrix-0.2.9/bin:$PATH
 +
  setenv LD_LIBRARY_PATH /&lt;edit as appropriate&gt;/mrtrix-0.2.9/lib
 +
 
 +
*''Note:'' You have to open a new shell before these changes will take effect.
 +
 
 +
= Enable Multi-Threading  =
 +
 
 +
By default MRtrix will read a configuration file for additional options. Among those options is Multi-Threading. <br> The configuration file (.mrtrix.conf) should be stored in your home directory. <br>  
Run the following command in your shell to enable the multi-threading option in MRtrix - you can adjust the number of threads as you like.  
Run the following command in your shell to enable the multi-threading option in MRtrix - you can adjust the number of threads as you like.  
-
  echo "NumberOfThreads: 4" > $HOME/.mrtrix.conf
 
-
Setting the number of threads to a large value (e.g., 130) will use all the available cores on the current machine without crashing. See the [http://www.brain.org.au/software/mrtrix/install/unix.html MRtrix documentation] for more info.
+
  echo "NumberOfThreads: 4" &gt; $HOME/.mrtrix.conf
-
= Running the program =
+
Setting the number of threads to a large value (e.g., 130) will use all the available cores on the current machine without crashing. See the [http://www.brain.org.au/software/mrtrix/install/unix.html MRtrix documentation] for more info.
 +
 
 +
= Running the program =
 +
 
 +
To check that you can run MRtrix (ie that the install went ok) try:
-
To check that you can run MRtrix (ie that the install went ok) try:
 
   mrview
   mrview
 +
If you get a window, relax, everything worked out just fine.
If you get a window, relax, everything worked out just fine.

Latest revision as of 13:36, 10 July 2015

MRtrix is a set of tools to perform diffusion-weighted MR white-matter tractography in a manner robust to crossing fibers, using constrained spherical deconvolution (CSD) and probabilistic streamlines. This page describes how to install and use this package with our Fedora machines and data in the VISTA laboratory.

Elsewhere, we describe how to run MRtrix on local data.

We often use MRtrix along with the Linear Fascicle Evaluation (LiFE) technology. We describe how to run LiFE on a separate page .

Contents

[edit] Install MRtrix

If you are running Ubuntu, mrtrix is part of the neurodebian command set. You should check to see that the neurodebian repo is installed, and then use that to install the mrtrix package.

MRtrix can also be downloaded from this site.

There is a github repository for the developmental versions.

See Michael Perry about dockerization.

VistaLab users can simply add the MRtrix direcotry to their bash path in bashrc.

 # For MRTRIX 
if [ "$(hostname)" == "azure.stanford.edu" ]; then
    export PATH=/white/local/mrtrix/v0.2.7/bin:$PATH
    export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.7/lib:$LD_LIBRARY_PATH
elif [ "$(hostname)" == "peach.stanford.edu" ]; then
    export PATH=/white/local/mrtrix/v0.2.10/bin:$PATH
    export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.10/lib:$LD_LIBRARY_PATH
else
    export PATH=/usr/lib/mrtrix/bin:$PATH
fi
  • Note that azure will only run v2.7 while peach runs v2.10. All other machines run the up-to-date Neurodebian version.
  • If you're using Fedora 12 use the following line instead of the one just above
  export PATH=/white/local/mrtrix/v0.2.10_fc12/bin:$PATH
 export LD_LIBRARY_PATH=/white/local/mrtrix/v0.2.10_fc12/lib/

[edit] Build MRtrix

If you would prefer to download/build/configure the latest version of MRtrix for your machine, keep reading...

Download:: The tar-ball can be downloaded from NITRC.

  • If you are lucky enough to be running Ubuntu, you can simply install the neurodebian repo and install the mrtrix package through that.
  • There is a WINDOWS exe, which you can download from NITRC.

Install required Libs: Before you can build the program for linux you need to install some libraries:

  • g++ - the GNU C++ compiler (version > 4.0.0 recommended)
  • python (version > 2.5 recommended)
  • glib (version > 2.16)
  • gtk+ (version > 2.12)
  • glibmm (version > 2.16)
  • gtkmm (version > 2.12)
  • gtkglext (version > 1.0)
  • GSL (GNU Scientific Library; version > 1.8)
  • OpenGL implementation (version > 1.2)

On 64-bit Fedora you can install these packages using the following command (if you don't have sudo on your machine, find someone who does):

 sudo yum install glibmm24.x86_64 gtkmm24.x86_64 glib.x86_64 glib2-devel.x86_64 glib2.x86_64 gtkmm-utils.x86_64 gtkmm24-devel.x86_64 gtkglext-devel.x86_64 gtkglext-libs.x86_64 gtkglextmm-devel.x86_64 gtkglextmm.x86_64 gsl-devel.x86_64 gsl.x86_64 compat-libstdc++-33.x86_64 libstdc++-devel.x86_64 libstdc++.x86_64

Build

Unpack archive and compile:

   tar xjf mrtrix-0.2.9.tar.bz2
  cd mrtrix-0.2.9/
  ./build

Set the Path in .bashrc:

Set appropriate environment variables:

Bash shell:

   export PATH=/<edit as appropriate>/mrtrix-0.2.9/bin:$PATH
  export LD_LIBRARY_PATH=/<edit as appropriate>/mrtrix-0.2.9/lib

C shell:

   setenv PATH /<edit as appropriate>/mrtrix-0.2.9/bin:$PATH
  setenv LD_LIBRARY_PATH /<edit as appropriate>/mrtrix-0.2.9/lib
  • Note: You have to open a new shell before these changes will take effect.

[edit] Enable Multi-Threading

By default MRtrix will read a configuration file for additional options. Among those options is Multi-Threading.
The configuration file (.mrtrix.conf) should be stored in your home directory.

Run the following command in your shell to enable the multi-threading option in MRtrix - you can adjust the number of threads as you like.

 echo "NumberOfThreads: 4" > $HOME/.mrtrix.conf

Setting the number of threads to a large value (e.g., 130) will use all the available cores on the current machine without crashing. See the MRtrix documentation for more info.

[edit] Running the program

To check that you can run MRtrix (ie that the install went ok) try:

 mrview

If you get a window, relax, everything worked out just fine.

Personal tools