RTK wiki help: Difference between revisions

From Openrtk
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
[http://www.openrtk.org/RTK/resources/resources.html Ressources]
[http://www.openrtk.org/RTK/resources/resources.html Ressources]


== Users ==
[http://www.openrtk.org/RTK/project/contactus.html Contact us]


In this section you will find useful and necessary information in order to proceed using RTK:
== What is RTK? ==
RTK is an open source C++ library, not an executable. This means that you must write code that uses RTK and compile it before you will obtain something that you can run and get a result from. It also means that you can adapt or extend RTK to address your problem at hand. To facilitate this over multiple operating systems, compilers, and system configurations, RTK itself must be built from its source code. RTK is based on [http://www.itk.org The Insight Toolkit], therefore you would need to get, configure and compile The Insight Toolkit first.


* [[RTK/Users|User's guide section]]
The three steps to starting to work with RTK are therefore:


== Developers ==
#Download and Build the ITK source
#Download/Obtain/Get the RTK source
#Build the RTK library
#Write your own code that uses RTK and build it, linking to the RTK library.


In this section you will find the necessary information to start developing for RTK:
In the next sections we describe each of these steps.


* [[RTK/Developers|Developer's guide section]]
== Requirements ==
In order to compile RTK you will need the following:
* GIT (in order to get the software)
* CMake (in order to configure RTK)
* C/C++ compiler
 
== Step 0 - Getting ITK ==
'''RTK currently uses ITK 3.20'''.
 
We recommend to look into the [http://www.itk.org/Wiki/ITK ITK wiki] in order to compile ITK for your system. The documentation for ITK should be fairly straight forward. Moreover, the concepts for building ITK are very similar to those for RTK. In order to get ITK 3.20 from git:
 
  git clone git://itk.org/ITK.git
  cd ITK
  git checkout release-3.20
 
One important CMake option to make sure is enabled is the ITK_USE_REVIEW which should be set to ON when running CMake on ITK.
 
  ITK_USE_REVIEW ON
 
Not that you don't need to build the examples, the documentation or any of the tests to use ITK with RTK.
 
== Step 1 - Getting RTK ==
This page documents how to download RTK through [http://git-scm.com Git].
Follow the ITK [[Git/Download|Git download instructions]] to install Git.
 
To get the latest source code for RTK:
  git clone git://github.com/SimonRit/RTK.git
 
== Step 2 - Building RTK ==
Like ITK, in order to build RTK you would need to install [CMake www.cmake.org]. CMake supports out of source build so we recommend to create a binary directory 'RTK-bin'
 
  mkdir RTK-bin
  cd RTK-bin
  cmake ../RTK
 
When CMake asks for the ITK_DIR, specify the binary directory where ITK is built.
 
  ITK_DIR /path to directory/ITK-bin
 
== Step 3 - Running the HelloWorld application ==
In order to verify the installation of your RTK library, you can run the HelloWorld application. This application is part of the RTK examples and should be built by default. Otherwise make sure that
 
  BUILD_EXAMPLES ON
 
when configuring RTK with CMake.
 
= Tutorials =
 
== Tutorial 0 - Building an HelloWorld application with RTK ==
RTK is a library, therefore it's meant to be integrated into application. This tutorial shows how to create a simple HelloWorld project that links with RTK. '''The source code for this tutorial is located in RTK/examples/HelloWorld'''.
 
* First you need to create a CMakeLists.txt with the following lines:
 
  # This project is designed to be built outside the RTK source tree.
  PROJECT(HelloWorld)
 
  # Find the RTK libraries and includes
  FIND_PACKAGE(RTK REQUIRED)
  INCLUDE(${RTK_USE_FILE})
 
  # Executable
  ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )
  TARGET_LINK_LIBRARIES(HelloWorld ${RTK_LIBRARIES})
  TARGET_LINK_LIBRARIES(HelloWorld ${ITK_LIBRARIES})
 
* Create a HelloWorld.cxx file
 
  #include <rtkFDKBackProjectionImageFilter.h>
 
  int main(int argc, char **argv)
  {
  // Define the type of pixel and the image dimension
  typedef float OutputPixelType;
  const unsigned int Dimension = 3;
 
  // Define the type of image
  typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
 
  // Define and allocate the FDK Back Projection Filter
  typedef rtk::FDKBackProjectionImageFilter<OutputImageType, OutputImageType> BPType;
  BPType::Pointer p = BPType::New();
 
  std::cout << "RTK Hello World!" << std::endl;
 
  return 0;
  }
 
* Run CMake on the HelloWorld directory and create a HelloWorld-bin
* Configure and build the project using your favorite compiler
* Run the HelloWorld application. If everything runs correctly you should see "RTK Hello World!" written on the console.
 
== Tutorial 1 - My first reconstruction ==
[[RTK/Examples/FirstReconstruction | Reconstruct a Sphere]]
 
= Applications =
 
RTK also provide a set of command line applications that are compiled if the cmake option BUILD_APPLICATIONS is turned on. Each application uses [[http://www.gnu.org/software/gengetopt/gengetopt.html gengetopt]] to allow parsing of the command line options. The manual of each application can be obtained with the --help or -h option. They can be executed sequentially in bash scripts.
 
== Script 1 - FDK ==
 
[[RTK/Scripts/FDK | FDK Shepp Logan ]]
 
== Script 2 - Forward Projection ==
 
[[RTK/Scripts/ForwardProjection | POPI projections and reconstruction ]]
 
= Geometry =
 
The description of the [http://www.openrtk.org/Doxygen/classrtk_1_1ThreeDCircularProjectionGeometry.html 3D circular geometry] is based on the international standard IEC 61217 which has been designed for cone-beam imagers on isocentric radiotherapy systems but it can be used for any 3D circular trajectory. The fixed coordinate system of RTK and the fixed coordinate system of IEC 61217 are the same. A clear understanding of the geometry is essential for the use of a tomography package. The geometry description has been written in a [https://github.com/SimonRit/RTK/blob/master/documentation/geometry.tex latex document] compiled [http://www.creatis.insa-lyon.fr/~srit/geometry.pdf here].
 
= Developer's corner =
 
== Developer's documentation ==
 
We only provide the [http://www.openrtk.org/Doxygen/index.html doxygen documentation] at the moment.
 
== Coding style  ==
 
RTK is based on ITK and aims at following its coding conventions. Any developer should follow these conventions when submitting new code or contributions to the existing one. We strongly recommend you to read thoroughly [http://www.itk.org/Wiki/ITK/Coding_Style_Guide ITK's style guide].

Revision as of 10:08, 22 October 2012

Welcome to RTK

The Reconstruction Toolkit (RTK) is an open-source and cross-platform software for fast circular cone-beam CT reconstruction based on the Insight Toolkit (ITK). RTK is developped by the RTK consortium. This is the wiki documentation, other information is available here:

Main page

Project

Ressources

Contact us

What is RTK?

RTK is an open source C++ library, not an executable. This means that you must write code that uses RTK and compile it before you will obtain something that you can run and get a result from. It also means that you can adapt or extend RTK to address your problem at hand. To facilitate this over multiple operating systems, compilers, and system configurations, RTK itself must be built from its source code. RTK is based on The Insight Toolkit, therefore you would need to get, configure and compile The Insight Toolkit first.

The three steps to starting to work with RTK are therefore:

  1. Download and Build the ITK source
  2. Download/Obtain/Get the RTK source
  3. Build the RTK library
  4. Write your own code that uses RTK and build it, linking to the RTK library.

In the next sections we describe each of these steps.

Requirements

In order to compile RTK you will need the following:

  • GIT (in order to get the software)
  • CMake (in order to configure RTK)
  • C/C++ compiler

Step 0 - Getting ITK

RTK currently uses ITK 3.20.

We recommend to look into the ITK wiki in order to compile ITK for your system. The documentation for ITK should be fairly straight forward. Moreover, the concepts for building ITK are very similar to those for RTK. In order to get ITK 3.20 from git:

 git clone git://itk.org/ITK.git
 cd ITK
 git checkout release-3.20

One important CMake option to make sure is enabled is the ITK_USE_REVIEW which should be set to ON when running CMake on ITK.

 ITK_USE_REVIEW ON

Not that you don't need to build the examples, the documentation or any of the tests to use ITK with RTK.

Step 1 - Getting RTK

This page documents how to download RTK through Git. Follow the ITK Git download instructions to install Git.

To get the latest source code for RTK:

 git clone git://github.com/SimonRit/RTK.git

Step 2 - Building RTK

Like ITK, in order to build RTK you would need to install [CMake www.cmake.org]. CMake supports out of source build so we recommend to create a binary directory 'RTK-bin'

 mkdir RTK-bin
 cd RTK-bin
 cmake ../RTK

When CMake asks for the ITK_DIR, specify the binary directory where ITK is built.

 ITK_DIR /path to directory/ITK-bin

Step 3 - Running the HelloWorld application

In order to verify the installation of your RTK library, you can run the HelloWorld application. This application is part of the RTK examples and should be built by default. Otherwise make sure that

 BUILD_EXAMPLES ON

when configuring RTK with CMake.

Tutorials

Tutorial 0 - Building an HelloWorld application with RTK

RTK is a library, therefore it's meant to be integrated into application. This tutorial shows how to create a simple HelloWorld project that links with RTK. The source code for this tutorial is located in RTK/examples/HelloWorld.

  • First you need to create a CMakeLists.txt with the following lines:
 # This project is designed to be built outside the RTK source tree.
 PROJECT(HelloWorld)
 # Find the RTK libraries and includes
 FIND_PACKAGE(RTK REQUIRED)
 INCLUDE(${RTK_USE_FILE})
 # Executable
 ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )
 TARGET_LINK_LIBRARIES(HelloWorld ${RTK_LIBRARIES})
 TARGET_LINK_LIBRARIES(HelloWorld ${ITK_LIBRARIES})
  • Create a HelloWorld.cxx file
 #include <rtkFDKBackProjectionImageFilter.h>
 int main(int argc, char **argv)
 {
 // Define the type of pixel and the image dimension
 typedef float OutputPixelType;
 const unsigned int Dimension = 3;
 // Define the type of image
 typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
 // Define and allocate the FDK Back Projection Filter
 typedef rtk::FDKBackProjectionImageFilter<OutputImageType, OutputImageType> BPType;
 BPType::Pointer p = BPType::New();
 std::cout << "RTK Hello World!" << std::endl;
 return 0;
 }
  • Run CMake on the HelloWorld directory and create a HelloWorld-bin
  • Configure and build the project using your favorite compiler
  • Run the HelloWorld application. If everything runs correctly you should see "RTK Hello World!" written on the console.

Tutorial 1 - My first reconstruction

Reconstruct a Sphere

Applications

RTK also provide a set of command line applications that are compiled if the cmake option BUILD_APPLICATIONS is turned on. Each application uses [gengetopt] to allow parsing of the command line options. The manual of each application can be obtained with the --help or -h option. They can be executed sequentially in bash scripts.

Script 1 - FDK

FDK Shepp Logan

Script 2 - Forward Projection

POPI projections and reconstruction

Geometry

The description of the 3D circular geometry is based on the international standard IEC 61217 which has been designed for cone-beam imagers on isocentric radiotherapy systems but it can be used for any 3D circular trajectory. The fixed coordinate system of RTK and the fixed coordinate system of IEC 61217 are the same. A clear understanding of the geometry is essential for the use of a tomography package. The geometry description has been written in a latex document compiled here.

Developer's corner

Developer's documentation

We only provide the doxygen documentation at the moment.

Coding style

RTK is based on ITK and aims at following its coding conventions. Any developer should follow these conventions when submitting new code or contributions to the existing one. We strongly recommend you to read thoroughly ITK's style guide.