Download‎ > ‎

Compile DSI Studio on Windows/Mac/Linux

Compile DSI Studio on Windows




1. Download Qt MinGW


Download qt-opensource-windows-x86-1.6.0-8-online.exe at https://www.qt.io/download-open-source/ and install [Qt 5.4][msvc2013 64-bit OpenGL] and [Qt 5.4][msvc2013 32-bit OpenGL] as well as [Tools][Qt Creator]

2. Download Visual Studio Community 2013


       Download VS2013 at https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx and install it.

3. Download DSI Studio source code, boost library, and TIPL library 


Download DSI Studio source code at https://github.com/frankyeh/DSI-Studio

Download boost library 1.57 at http://www.boost.org/users/history/version_1_57_0.html and unzip the file in a directory

There is no need to build boost for DSI Studio. Just copy the header files under the DSI_STUDIO_DIRECTORY/boost.

You also need to download TIPL  (https://github.com/frankyeh/TIPL) and put them under DSI_STUDIO_DIRECTORY/image. 

4. Build DSI Studio

        To run DSI Studio you may also need to download template files from the zip files provided from the download page.

Compile DSI Studio on Mac



1. Install Xcode


Xcode can be downloaded from https://developer.apple.com/downloads/index.action

Once should note that if you compile it on an older version of Mac, e.g. 10.5. Leopard. You may need to figure out the right version of Xcode for your system. Xcode 3.1.4 is the latest version that runs on 10.5 Leopard. If you already have that on your system DVDs, then you don't need to download it. Otherwise there are a fair number of bug fixes, so you may find 3.1.4 valuable.


        The newest version Xcode may not contain gcc for building boost library. To get gcc, open Xcode and select [Xcode] [preference].        
        Under the download tab, install the command line tools.

2. Install Qt


Download Qt installer at https://www.qt.io/download-open-source/ and install it. 

Download Qt creator from qt-project.org. 

3. Download DSI Studio source code, boost library, and TIPL library 


Download DSI Studio source code at https://github.com/frankyeh/DSI-Studio

Download boost library 1.57 at http://www.boost.org/users/history/version_1_57_0.html and unzip the file in a directory

There is no need to build boost for DSI Studio. Just copy the header files under the DSI_STUDIO_DIRECTORY/boost.

You also need to download TIPL  (https://github.com/frankyeh/TIPL) and put them under DSI_STUDIO_DIRECTORY/image. 


5. Build DSI Studio


Open Qt creator, load the dsi_studio.pro file and turns to the projects page->manage Kits. Under Qt version tab, you need to add in the complied qmake, which can be found in the Qt installation folder (under QTDIR/bin). Then under Kits tab, manually add a new make tool, select GCC X86_64 (use GCC X86_32 for 32-bit) for compiler, and the Qt version is the one that is just built.

Change build configuration to "Release". Run build all. it should build DSI Studio

6. Download accessory files

        You may need to download atlas and template from any packages listed in the DSI Studio download page. The template should be placed at dsi_studio.app/Contents/MacOS/dsi_studio whereas the atlas placed under dsi_studio.app/Contents/MacOS/dsi_studio/atlas

Compile DSI Studio on Linux


Installation instructions by: Max Novelli 09/19/2012. This how-to was written while installing DSI Studio on an Ubuntu 12.04 64bit system with nVidia drivers downloaded directly from nvidia site. 

The source code requires g++ > 4.9. You need to configure compiler option to include -std=c++11 or -std=gnu++11 

In Ubuntu, 
gcc-4.9 must be used. However, the Ubuntu system may report gcc-4.8 as the most current, i.e. apt-get does not show it. This is because the OS only shipped with 4.8 and the “updates” are only for that version.

To get 4.9:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9

Install Qt


1) If you are using standard nVidia drivers that comes with your Ubuntu distribution, you can use standard qmake and qt libraries coming with ubuntu.

1.1) install qmake, qt tools and libraries

> sudo apt-get install qt5-qmake qt5-dev-tools

This should install all the needed dependencies

1.2) skip to step 3

2) If you are using custom installed nvidia drivers downloaded directly from nvidia website, we need to custom compile qt and link it to the nvidia libraries that are installed by the nvidia package. If you use the standard qt package, qt will be linked to the standard libraries and dsi studio will through an error, most likely at compilation time, because version of the open-gl libraries that it expects and the one available are different. 2.1) Prepare system to install qt libraries. We need to install some dependencies for qt to be able to compile (please refer to the following URL for more info: - http://www.qtforum.org/article/27401/debian-xlib-test-failed-after-configure.html)

        
> sudo apt-get build-dep qt5-qmake


2.2) visit qt page to figure out the latest version of qt 
(version 5.4 at the time of this writing):

- http://qt.nokia.com/downloads/linux-x11-cpp

2.3) download tar file:

> wget http://releases.qt-project.org/qt5/source/qt-everywhere-opensource-src-5.4.tar.gz

2.4) expand and get ready to compile


> tar xvzf qt-everywhere-opensource-src-5.4.tar.gz           
> cd qt-everywhere-opensource-src-5.4


2.5) configure step. We place all our custom compiled package under 
/usr/local/pkg. You can change the location anyway you like, as long as you change the qmake alias path accordingly. Webkit has been excluded because, apparently, does not play well with Ubuntu 12.04 and the version of gcc coming with it.

> ./configure --prefix=/usr/local/pkg/qt/5.4 -no-webkit


2.6) compile

> make


2.7) install

> sudo make install


2.8) create qmake alias

> alias qmake=”/usr/local/pkg/qt/5.4/bin/qmake”



Compile DSI Studio and dependencies


3) install dependencies for dsi-studio


> sudo apt-get install git
> sudo apt-get install libboost-all-dev
> sudo apt-get install zlib1g zlib1g-dev


4) create working folder

> mkdir dsistudio
> cd dsistudio


5) download source code from git

> git clone -b master git://github.com/frankyeh/DSI-Studio.git src

6) you need to download additional libraries and place them into the right directories. Here are the links to their main repositories


- Image: https://github.com/frankyeh/TIPL/archive/master.zip
put it under ../src/image


7) create build folder

> mkdir build
> cd build

8) configure step

> qmake ../src


9) compile step

> make


Install DSI Studio


10) install step

> sudo mkdir /usr/local/pkg/dsistudio/20120919

> sudo cp dsi_studio /usr/local/pkg/dsistudio/20120919/dsi_studio

11) atlas files. DSI Studio needs a template image file called HCP842_QA.nii.gz and a mask file named brain_mask.nii.gz. The other atlas files are optional. If included, they should be placed under a subfolder named atlas. You may find these files at https://www.dropbox.com/s/rq5khgmoyiye0op/dsi_studio_other_files.zip?dl=0

Additional instruction for Linux Fedora

#
# Installiation Instruction for Linux Fedora
# By West, John at Indiana University – Purdue University Indianapolis
# 2013/02/15



The compiling was pretty much exactly the same. The difference is packages needed as prereqs are different in Fedora than in Ubuntu.

From step 1.1

> sudo apt-get install qt5-qmake qt5-dev-tools ---> sudo yum install qt qt-devel qt-create (NOTE: I installed qt-create while we were debugging, so that may not be necessary)

From step 3

> sudo apt-get install git ---> sudo yum install git
> sudo apt-get install libboost-all-dev ---> sudo yum install boost boost-dev
> sudo apt-get install zlib1g zlib1g-dev ---> sudo yum install zlib zlib-dev

I should also mention that this was done on Fedora 17 (possible other versions may have different issues) and that I installed the Nvidia drivers (replacing nouveau - open source nvidia drivers in Fedora) using the instructions on the following website: http://www.if-not-true-then-false.com/2012/fedora-17-nvidia-guide/ . Note, I followed the akmod-nvidia instructions under step 4. I'm not sure if doing kmod or kmod-PAE would affect things. Instructions for other Fedora versions are available as well.

Only other difference is that for Fedora (17 at least) qmake and qmake-qt4 are one in the same but only qmake-qt5 is provided as a link. So I had to use the qmake-qt4 command in step 8:

So in step 8:

> qmake ../src becomes qmake-qt5 ../src

Also, please note that the environment variable defined in step 11.3 did not work for the template. I had to store the template (NTU90_QA.nii.gz) in the same directory as the dsistudio executable.



Another instruction from Pete Hurd:

# installing DSI studio on Fedora 22 -Pete Hurd, Sept 2015.
# note: John West's notes has these packages ending in "dev" rather than "devel"

sudo dnf install qt qt-devel
sudo dnf install git
sudo dnf install boost boost-devel
sudo dnf install zlib zlib-devel
sudo dnf install qt5-qtbase-devel
sudo dnf install mesa-libGLU-devel
sudo dnf install gcc-c++

# vanilla 'sudo dnf install qt5-qtbase-devel' tried to downgrade a shedload of things, then failed....

sudo dnf install qt5-qtbase-devel-5.5.0

cd src
mkdir image
cd ..

# hit 'download' link in https://github.com/frankyeh/TIPL to download TIPL-master.zip,
# then unzip it and put the contents in 'image', so that that the file image.hpp is in the 'image' subdir.

mkdir build
cd build/
qmake-qt5 ../src

# then edit Makefile to add flag -std=c++11 to CXXFLAGS to allow 'auto' to work in the new school way

make

then install dsi_studio, then find the required HCP488_QA.nii.gz and install as noted elsewhere...

Additional note for RedHat and CentOS


   You may need to modify dsi_studio.pro

   include -lboost_thread-mt instead of -lboost_thread

   (information provided by Miro Drahos)


Installation Instruction for Debian

# contributed by Olivier Kaloudoff <debian@kalou.net>

To install DSI-Studio on your Debian system;
If you are using the squeeze (aka stable) distribution, add the 3 lines below to your /etc/apt/sources.list

# For DSI-Studio

deb http://s.kalou.net/apt wheezy main deb-src http://s.kalou.net/apt wheezy main
Then, perform
sudo apt-get update sudo apt-get install dsi-studio
If you are using the wheezy (aka testing) distribution, add the 3 lines below to your /etc/apt/sources.list # DSI Studio and boost backports
deb http://s.kalou.net/apt squeeze main deb-src http://s.kalou.net/apt squeeze main
Then, perform
sudo apt-get update sudo apt-get install dsi-studio




Comments