# RTK installation problem any help appreciated

**URL:** <https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481>\
**Category:** Uncategorized\
**Created:** [December 6, 2019, 2:25pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481 "2019-12-06T14:25:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)\
**Post date:** [December 6, 2019, 2:25pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/1 "2019-12-06T14:25:54Z")

</div>

Hi,

Firstly thank you for the help!

1. I did download the RTK, then I separately from ITK tried to build the RTK source code but failed with different configuration errors in CMake before generate and build it in vs2017 just like I did with VTK & ITK. Then I saw article that I should copy it to the Modules folder of ITK and build and install them together! this worked but when I tried to test my installation with HelloWorld of RTK it gives error in configure in CMake that RTK is not installed!? technically RTK is all under ITK and there is no path for RTK in my system path!

2. This is HelloWorld/CMakeList.txt file:

```auto
cmake_minimum_required(VERSION 2.8)
project(HelloWorld)

if(NOT TARGET RTK)
   find_package(RTK REQUIRED)
   include(${RTK_USE_FILE})
endif

add_executable(HelloWorld HelloWorld.cxx)
target_link_libraries(HelloWorld ${RTK_LIBRARIES})
target_link_libraries(HelloWorld ${ITK_LIBRARIES})

```

can I set the path for RTK which is nested inside the ITK with set or set path inside this HelloWorld/CMakeLists.txt file so the build process can go and find RTK build inside the ITK build which is on my system path of PC?

1. How do you install RTK separately from ITK without getting stuck in CMake configure step?

Regards  
sag

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [December 6, 2019, 2:55pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/2 "2019-12-06T14:55:34Z")

</div>

@simon.rit can best answer this. But have you tried:

```auto
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

```

If you placed RTK into Modules (or enabled `Module_RTK` when configuring ITK), RTK should be one of ITK’s modules and you should not need special configuration for it.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [December 6, 2019, 3:22pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/3 "2019-12-06T15:22:33Z")

</div>

`RTK` needs to be added to the `find_package(ITK [...]` `COMPONENTS`. i.e.

```auto
cmake_minimum_required(VERSION 2.8)
project(HelloWorld)

find_package(ITK REQUIRED
  COMPONENTS
    RTK
    ITKCommon
    ITKImageIO
    # [...]
    # Any other ITK modules identified by the WhatModulesITK.py
  )
include(${ITK_USE_FILE})

add_executable(HelloWorld HelloWorld.cxx)
target_link_libraries(HelloWorld ${ITK_LIBRARIES})

```

See also the [WhatModulesITK.py](https://github.com/InsightSoftwareConsortium/ITK/blob/05f6c9fbd7e09fc26603c02fc7fd5cbcb2b47f4f/Utilities/Maintenance/WhatModulesITK.py) script.

---

<div class="post-metadata">

**Author:** ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)\
**Post date:** [December 6, 2019, 8:34pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/4 "2019-12-06T20:34:30Z")

</div>

Hi mat,

thanks for the help it worked. I have been struggling with the file format for example firstReconstruction in rtf examples. I managed to build it.  
it seems that I have to run it as follows:

FirstReconstruction.exe outputimage.xxx outputgeometry.rtk  
question: what would be the format for output image.xxx?  
secondly is that correct to set geometry file format to .rtk?  
thirdly, it seems that the output image is a 3D image I assume! but how to view this image?

Regards,  
sag

---

<div class="post-metadata">

**Author:** ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)\
**Post date:** [December 6, 2019, 8:36pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/5 "2019-12-06T20:36:07Z")

</div>

hi dzenanz,

thanks for the help it worked. I have been struggling with the file format for example firstReconstruction in rtf examples. I managed to build it.  
it seems that I have to run it as follows:

FirstReconstruction.exe outputimage.xxx outputgeometry.rtk  
question: what would be the format for output image.xxx?  
secondly is that correct to set geometry file format to .rtk?  
thirdly, it seems that the output image is a 3D image I assume! but how to view this image?

Regards,  
sag

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [December 6, 2019, 8:50pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/6 "2019-12-06T20:50:10Z")

</div>

Hi @sag,

In case it is helpful, note that there is a [CMakeLists.txt](https://github.com/SimonRit/RTK/blob/master/examples/FirstReconstruction/CMakeLists.txt) for the FirstReconstruction example.

> [@sag](#):
>
> what would be the format for output image.xxx?

ITK supports many formats, but standby’s are MetaImage, `*.mha` or NRRD, `*.nrrd`.

> [@sag](#):
>
> secondly is that correct to set geometry file format to .rtk?

[XML (`.xml`)](http://www.openrtk.org/Doxygen/DocGeo3D.html)

> [@sag](#):
>
> it seems that the output image is a 3D image I assume! but how to view this image?

A few good options:

- [Click on the itk-vtk-viewer webapp page](https://kitware.github.io/itk-vtk-viewer/app/)
- [itkwidgets](https://github.com/InsightSoftwareConsortium/itkwidgets)
- [ITK-SNAP](http://www.itksnap.org/pmwiki/pmwiki.php)
- [3D Slicer](https://www.slicer.org/)

I hope this helps,  
Matt

---

<div class="post-metadata">

**Author:** ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)\
**Post date:** [December 6, 2019, 10:12pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/7 "2019-12-06T22:12:32Z")

</div>

hi matt,

Thank you it worked. I would like to write a 3d viewer myself any ideas where I can get some info, code, anything that help me to write it. I would like to use it in MFC, android, mobile app, etc. and place it in a grid like view to process it with mouse interaction.

Regards,  
sag

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [December 6, 2019, 10:49pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/8 "2019-12-06T22:49:40Z")

</div>

The most universal applications now are progressive web apps like [itk-vtk-viewer](https://github.com/Kitware/itk-vtk-viewer) or [ParaViewGlance](https://github.com/kitware/paraview-glance).

---

<div class="post-metadata">

**Author:** ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)\
**Post date:** [December 7, 2019, 11:18am UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/9 "2019-12-07T11:18:45Z")

</div>

Hi matt,

Thanks you, I just saw my first reconstruction using RTK.

Regards,

---

<div class="post-metadata">

**Author:** ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)\
**Post date:** [December 8, 2019, 9:13pm UTC](https://discourse.itk.org/t/rtk-installation-problem-any-help-appreciated/2481/10 "2019-12-08T21:13:10Z")

</div>

Thanks a lot @matt.mccormick and @dzenanz for helping @sag. I hadn’t realize that the HelloWorld code was on RTK’s wiki, I have removed it from the tree a few weeks ago because it was outdated (precisely the issue that @sag encountered) and I thought that FirstReconstruction was sufficient. I have updated the wiki to correct this but a few other things are outdated and I’ll work on a better introduction for users.
