/**

\page Installation Installation Guidelines

The steps outlined below describe the whole procedure to build and install CapTk. CapTk will be distributed in the form of Windows and Linux installers by default.

## 1. Running the pre-built binaries

The primary deployment mode for CapTk is via pre-built binaries for Windows. The package is self-sustaining and users don't need to do anything extra. *-ix users will need to build the package from source - we will be distributing pre-built packages for future releases.


## 2. Dependencies

Before building CapTk, the following software libraries are required to be installed. <strong>Please note</strong> that to build in Windows, CMake needs to be used an appropriate compiler (Win32 or Win64 version of Visual Studio is recommended). The selected solution platform is needed to match with dependent libraries.

<table border="0">
	<tr>
    <td width="7%"><strong>Package</strong></td>      
	  <td width="7%"><strong>Version</strong></td>      
    <td width="100%"><strong>Description</strong></td>  
	</tr>
	<tr>
		<td>Archiver</td>
		<td>n/a</td>
		<td><a href="http://www.gzip.org/">gzip</a> is recommended. <br><b>Windows Users</b>: <a href="http://www.7-zip.org/">7-zip</a></td>
	</tr>
	<tr>
		<td>C++ compiler</td>
		<td>n/a</td>
		<td>MSVC/11.x, MSVC/12.x, GCC/4.8.1, GCC/4.9.2 are supported. MSVC/13+ and GCC/5+ are <b>NOT</b> supported</td>
	</tr>
	<tr>
		<td><a href="http://www.cmake.org/">CMake</a></td>
		<td>2.8.4 or higher</td>
		<td>To compile and build CapTk and its dependencies</td>
	</tr>
  <tr>
		<td><a href="http://qt-project.org/downloads">Qt</a></td>
		<td>4.8.x</td>
		<td>The main GUI interface for CapTk. Download and install the precompiled library. <br><b>Windows Users</b>: consider visiting <a href="http://www.npcglib.org/~stathis/blog/precompiled-qt4-qt5/">this page</a> to download the precompiled binaries.</td>
	</tr>
	<tr>
		<td><a href="http://gdcm.sourceforge.net/wiki/index.php/Main_Page">GDCM</a></td>
		<td>2.5 and above</td>
		<td>The main DICOM parsing library for CapTk. Instructions to install GDCM are given <a href="http://gdcm.sourceforge.net/wiki/index.php/Installing_GDCM_2.2.0">here</a></td> 
	</tr>
	<tr>
		<td><a href="http://www.vtk.org/">VTK</a></td>
		<td>5.6.1 - 5.10.1</td>
		<td>Install Qt before setting VTK up. Instructions to compile VTK are given <a href="http://www.vtk.org/Wiki/VTK/Configure_and_Build">here</a>. During CMake configuration, enable the <b>VTK_USE_QT</b> flag.</td> 
	</tr>
	<tr>
		<td><a href="http://www.itk.org/">ITK</a></td>
		<td>current master</td>
		<td>Build VTK and GDCM before proceeding to compile ITK. Instructions to compile ITK are given <a href="http://www.itk.org/Wiki/ITK/Configuring_and_Building">here</a>. During CMake configuration, enable the <b>Module_ITKVtkGlue</b> and <b>ITK_USE_SYSTEM_GDCM</b> flags.</td>
	</tr>
	<tr>
		<td><a href="http://opencv.org/downloads.html">OpenCV</a></td>
		<td>3.0 or higher</td>
		<td>All machine learning algorithms. This generally comes pre-compiled; if not found for your system, steps similar to those done for VTK and ITK compilation can be followed.</td>
	</tr>
	<tr>
		<td><a href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</a></td>
		<td>n/a</td>
		<td>[OPTIONAL] For documentation only</td>
	</tr>
</table>

Ensure all dependencies are met before proceeding. 

## 3. Build

Please follow commands below in a shell/terminal (e.g., <a href="http://www.gnu.org/software/bash/">Bash</a>). They will configure and build CapTk using <a href="http://www.gnu.org/software/make/">GNU Make</a>. The main CMake configuration file (CMakeLists.txt) is located in the root directory of the package.

### 3.1 Extract source files and create the build directory

\verbatim
tar xzf CapTk-${version}-source.tar.gz
mkdir CapTk-${version}-build
cd CapTk-${version}-build
\endverbatim
<b>Windows Users</b>: an appropriate compression program (e.g., <a href="http://www.7-zip.org/">7-zip</a>) might be used to extract the files.

### 3.2  Run CMake to configure the build tree

\verbatim
cmake ../CapTk-${version}-source
\endverbatim
Use the CMake variable CMAKE_INSTALL_PREFIX to specify the installation
directory, as in:
\verbatim
cmake -DCMAKE_INSTALL_PREFIX=/opt/software/geodesic ../CapTk-${version}-source
\endverbatim

<b>Windows Users</b>: open CMake-GUI and select <code>CapTk-${version}-source</code> as the "source" directory and select <code>CapTk-${version}-build</code> as the "build" directory. Click on "Configure" and select the appropriate C++ compiler. If there weren't any configuration errors, click "Generate".

CMake should be able to find the dependencies if they are specified in the <code>$PATH</code> variable in your environment. If you have custom installation directories, then ensure that they have been added to the <code>$PATH</code> variable or point the variable(s) <b>${Dependency}_DIR</b> to the appropriate build paths where <b>${Dependency}Config.cmake</b> is/are present (for example, in the case of ITK, point <code>ITK_DIR</code> to the directory where <code>ITKConfig.cmake</code> is present) - this should be either the build directory or the installation directory. If you are using a bash shell, it can be done using the following command:

\verbatim
cmake -DITKDIR=${path_to_custom_ITK_build_dir} -DVTK_DIR=${path_to_custom_VTK_build_dir} -DQT_QMAKE_EXECUTABLE=${path_to_custom_qt_installation} CapTk-${version}-source
\endverbatim

<b>Windows Users</b>: set the variables <code>ITK_DIR</code>, <code>VTK_DIR</code> and <code>QT_QMAKE_EXECUTABLE</code> using the CMake-GUI.

This step will generate compiler-specific project files (for example, Make file for GCC and Visual Studio solution file for MSVC). For a full list of generators, please see <a href="https://cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html">CMake documentation on generators</a></td>. CMake can be used to set various other configuration options and some of those options are:

<table border="0">
	<tr>
		<td width="200px"><b>BUILD_DOCUMENTATION</b></td>
		<td>Builds the documentation (HTML and PDF) from scratch</td>
	</tr>
	<tr>
		<td><b>BUILD_TESTING</b></td>
		<td>Enables unit testing of the software package</td>
	</tr>
	<tr>
		<td><b>CMAKE_INSTALL_PREFIX</b></td>
		<td>Path where the project will be installed</td>
	</tr>
	<tr>
		<td><b>PACKAGE_PROJECT</b></td>
		<td>Create installer for project (not available for all platforms)</td>
	</tr>
</table>

### 3.3 Compile the project

\verbatim
make
\endverbatim

<b>Windows Users</b>: you should launch the generated solution file of Visual Studio (by default, only <code>Release</code> version of the code will be compiled - if this needs to be changed, it can be done so by editing the variable <code>CMAKE_CONFIGURATION_TYPE</code> during the CMake configuration step), and then build solution.

### 3.4 [OPTIONAL] Compile the documentation

To build the documentation from scratch, the <code>BUILD_DOCUMENTATION</code> option in the CMake configuration needs to be enabled.

\verbatim
make doc
\endverbatim

<b>Windows Users</b>: build the <b>doc</b> project in the loaded solution.

### 3.5 [OPTIONAL] Test the Compilation

To perform tests, the <code>BUILD_TESTING</code> option in the CMake configuration needs to be enabled.

\verbatim
make test
\endverbatim

<b>Windows Users</b>: you should build the <b>RUN_TESTS</b> project.

In case of failing tests, re-run the tests, but this time by executing <a href="http://www.cmake.org/cmake/help/v2.8.8/ctest.html">CTest</a> directly with the '-V' option to enable verbose output and redirect the output to a text file, as in the example below (works for both Windows and Linux on the command line or shell):

\verbatim
ctest -V >& CapTk-test.log
\endverbatim

And send the file <b>CapTk-test.log</b> as attachment of the issue report to <mailto:software@cbica.upenn.edu>.

### 3.6 [OPTIONAL] Install 

\verbatim
make install
\endverbatim

<b>Windows Users</b>: you should build the <b>INSTALL</b> project.

Upon the success of the above compilation and build process, CapTk is installed into the directory specified by the <code>CMAKE_INSTALL_PREFIX</code>, which was set during step 3.2 above.

### 3.7 [OPTIONAL] Strip executables (Linux only) 

\verbatim
make install/strip
\endverbatim

<b>Note</b> - this is not needed if you plan to package the project.

### 3.8 [OPTIONAL] Package Project

\verbatim
make package
sudo dpkg -i CapTk-Linux.deb
\endverbatim

<b>Windows Users</b>: enable the <b>PACKAGE_PROJECT</b> flag in the CMake configuration step and build the <b>PACKAGE</b> project in Visual Studio.


*/
