
  Section of Biomedical Image Analysis
  Department of Radiology
  University of Pennsylvania
  3600 Market Street, Suite 380
  Philadelphia, PA 19104

  Web:   https://www.rad.upenn.edu/sbia/
  Email: sbia-software at uphs.upenn.edu



INTRODUCTION:
============
This installation guide is provided for Linux/Unix users. Specific commands are provided for those using Ubuntu.



Requirements:
============
To compile this software from source, the following software must first be installed:

1. CMake:  http://www.cmake.org/
 We suggest using version>2.8.5. Please visit the CMake website and follow the instructions for installation. 
*Ubuntu Users* the repository version of CMake is not necessarily up-to-date, so please visit the website and install the latest version.

2. C++ compiler (gcc/g++): gcc.gnu.org
  This software is tested with gcc ver4.3 on Ubuntu. Because MATLAB compilers (mcc and mex) are picky about glib, we recommend checking which compiler is compatible with your MATLAB version. For example, MATLAB R2010 is not compatible with gcc ver4.4 but works with ver4.3. Linux/Unix distributions are usually shipped with a compiler. The compiler version can be found by typing:

   # g++ -v
If the compiler is *not* compatible with your version of MATLAB, you may need to install an older version of gcc. The exact installation procedure differs based on the Linux distribution. You may need to consult with your system administrator and/or visit the GNU gcc website for more detail.
*Ubuntu Users* To install an older version of gcc (e.g. ver4.3 with MATLAB R2010b), simply navigate the Ubuntu menu to System > Administrator > Synaptic Package Manager, and search for the required version. Make sure that the libstdc++ and g++ packages corresponding to the desired version are also installed.

3. SBIA BASIS
  SBIA BASIS is necessary for a few APIs used in the CMAKE files. To install, retrive it from the BASIS SVN repository and read the installation instructions.

    svn co https://sbia-svn.uphs.upenn.edu/projects/BASIS/branches/basis-0.1 

In short, you need to download, compile and install BASIS, make sure that its binary files are in your PATH variable, and check that there is a an environment variable called BASIS_DIR pointing to the /cmake/ folder in the location of your BASIS installation. For example, if BASIS is installed in “/opt/basis”, add the following to your .bashrc file:

   export PATH=${PATH}:/opt/basis/bin
   export BASIS_DIR=/opt/basis/lib/cmake

4. MATLAB:  www.mathworks.com
   This software is tested with MATLAB R2010b. We do not expect any problems with other version of MATLAB. However, the following toolboxes are required to compile the software:
      MATLAB Compiler (for mcc)
      Image Processing Toolbox

5. ITK:  www.itk.org
   This software is compiled with ITK v3.20. Although there have been major changes in ITK v4.0, we believe that there is enough backward compatibility for this software; nevertheless, we have NOT tested it with ITK v4.0. 
   *Note* If your gcc version was not compatible with your version of MATLAB, and you needed to install an different gcc, you must re-compile ITK with that version. Compile ITK as shared LIBRARY and make sure that the “.so” files are in your LD_LIBRAY_PATH, for example, by adding the following line to your .bashrc:

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/ITK-3.2-shared/lib/InsightToolkit/


6. Weka:   http://www.cs.waikato.ac.nz/ml/weka/
    This software is tested with v3.7.3. We do not suggest using a Weka version < v3.7. Please visit the website for installation instructions. It is very straight forward! 
  *Note* Make sure that weka.jar is added to your CLASSPATH environment variable. To do so, add a line like this to your .bashrc :

  export CLASSPATH=/home/kayhan/bin/weka/weka.jar:$CLASSPATH
 

7. LIBLINEAR: http://www.csie.ntu.edu.tw/~cjlin/liblinear/
 This software is tested with v1.8. LIBLINEAR is a fast linear SVM solver used in the GONDOLA optimization procedure. 
 *Note* Make sure that you compile both LIBLINEAR and its MATLAB extension (mex files). The instruction may vary slightly depending on the version of LIBLINEAR; in general you must first download and decompress the tar-file to a folder. Inside of the folder, there is a MAKEFILE. Follow the LIBLINEAR installation instructions, change the MAKEFILE according to your settings and compile the LIBLINEAR by typing 'make'. Then go to the /matlab/ directory and change the MAKEFILE inside of that folder to make sure that the the extensions are also compiled.
 *Note*  You must create environment variable called LIBLINEAR_DIR. This can be done by adding a line to your  *.bashrc* file, for example:

   export  LIBLINEAR_DIR=/home/kayhan/bin/liblinear-1.8 

8. MOSEK:  http://www.mosek.com/
    This software is tested with v6.0 of MOSEK. MOSEK is used in optimizing one of the blocks. Since this is not free software and has a very limited application within GONDOLA, it will be replaced with a free alternative in the next update. For now, you must acquire an academic trial version of MOSEK for temporary usage. Please visit the MOSEK website, download the appropriate version of MOSEK (e.g. 64bit for Linux) and then request an academic trial key which is valid for 90 days:

      http://license.mosek.com/cgi-bin/student.py
 

9. Python:   www. python.org
 This software is tested with v2.6. Many of the scripts used in this software require Python. Most Linux distributions are shipped with an up-to-date version of Python; otherwise, it must be installed. Consult with your system administrator and/or visit the Python website for more details.


10. Jython:    www.jython.org
    This software is tested with v2.2. Jython is used to interface with Weka using Python syntax. The installation process may vary from one distribution of Linux to another; please visit the Jython website for detailed instruction.
*Ubuntu Users:*  Jython can be installed from the repository by typing:
        sudo    apt-get  install   jython 


11. SBIA Toolkit
      Part of the SBIA toolkit is necessary. Please download it from the the repository, then compile and install it.


12. SGE (optional)
      If you need to run several instances of the software, for example for cross-validation, SGE must be available on your system.



Compilation
================
Check the software out from the repository and compile it using cmake.
     
      #  svn co    https://sbia-svn.uphs.upenn.edu/projects/GONDOLA/trunck   GONDOLA
      #  mkdir  GONDOLA-build
      #  cd    GONDOLA-build
      #  ccmake  ../ GONDOLA
   
Then, generate a make file and compile it!



