# SlicerRT does not build due to missing ITK remote module

**URL:** https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214
**Category:** Development
**Tags:** slicerrt
**Created:** [March 19, 2019, 9:25pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214 "2019-03-19T21:25:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [March 19, 2019, 9:25pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/1 "2019-03-19T21:25:54Z")

</div>

SlicerRT does not build for a few days, since ITK was upgraded to version 5. The dashboard currently shows a trivial Plastimatch configuration error (saying that only ITK 3 and 4 are supported),the bigger problem is with an ITK remote that apparently has been removed woth this change. The error I get once bypassing the configuration problem is this:

`3>LINK : fatal error LNK1104: cannot open file 'ITKBioCell.lib' [C:\d\_Extensions\SlicerRT_D\inner-build\PlmBspline\plastimatch_slicer_bsplineLib.vcxproj]`

I found that I can include this missing remote with a CMake variable, for which I made a branch:

[https://github.com/cpinter/Slicer/commit/d67b9911ad20546f556bc914adb6e2f2f83ed21b](https://github.com/cpinter/Slicer/commit/d67b9911ad20546f556bc914adb6e2f2f83ed21b)

However, it does not help. When I build ITK like this, there is no apparent binary file created from the BioCell module (moved btw from Modules/Segmentation to Modules/Remote).

Has anyone encountered the same issue? Does anyone have any ideas how this could be fixed? Thanks!

---

<div class="post-metadata">

### Author: ![phcerdan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/phcerdan/32/1559_2.png) [@phcerdan](https://discourse.slicer.org/u/phcerdan)
#### Post date: [March 19, 2019, 9:52pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/2 "2019-03-19T21:52:32Z")

</div>

Hi @cpinter

If I enable BioCell in ITK, I can see the library `libitkBioCell-5.0.a` in both, the build and install tree:

build tree:

```bash
╭─ buildITK/ 
╰─ find . | grep BioCell 
./Utilities/Doxygen/Modules/BioCell.dox
./lib/libitkBioCell-5.0.a
./lib/cmake/ITK/Modules/BioCell.cmake
./Modules/Remote/BioCell
./Modules/Remote/BioCell/src
./Modules/Remote/BioCell/src/CMakeFiles
./Modules/Remote/BioCell/src/CMakeFiles/BioCell.dir
./Modules/Remote/BioCell/src/CMakeFiles/BioCell.dir/itkBioGene.cxx.o
./Modules/Remote/BioCell/src/CMakeFiles/BioCell.dir/itkBioGenome.cxx.o
./Modules/Remote/BioCell/src/CMakeFiles/BioCell.dir/Labels.json
./Modules/Remote/BioCell/src/CMakeFiles/BioCell.dir/itkBioGeneNetwork.cxx.o
./Modules/Remote/BioCell/src/CMakeFiles/BioCell.dir/itkBioCellularAggregateBase.cxx.o
./Modules/Remote/BioCell/src/CMakeFiles/BioCell.dir/itkBioCellBase.cxx.o
./Modules/Remote/BioCell/src/CMakeFiles/BioCell.dir/Labels.txt
./Modules/Remote/BioCell/src/cmake_install.cmake
./Modules/Remote/BioCell/ITKKWStyleFiles.txt
./Modules/Remote/BioCell/CMakeFiles
./Modules/Remote/BioCell/CMakeFiles/BioCell.cmake
./Modules/Remote/BioCell/cmake_install.cmake
./Modules/Core/Common/BioCellExport.h

```

install tree:

```bash
╭─ /tmp/ITK_INSTALL 
╰─ find . | grep BioCell
./include/ITK-5.0/BioCellExport.h
./include/ITK-5.0/itkBioCellularAggregate.hxx
./include/ITK-5.0/itkBioCellularAggregateBase.h
./include/ITK-5.0/itkBioCellBase.h
./include/ITK-5.0/itkBioCell.h
./include/ITK-5.0/itkBioCell.hxx
./include/ITK-5.0/itkBioCellularAggregate.h
./lib/libitkBioCell-5.0.a
./lib/cmake/ITK/Modules/BioCell.cmake

```

---

<div class="post-metadata">

### Author: ![phcerdan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/phcerdan/32/1559_2.png) [@phcerdan](https://discourse.slicer.org/u/phcerdan)
#### Post date: [March 19, 2019, 9:55pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/3 "2019-03-19T21:55:26Z")

</div>

Maybe we need to explicitly add it as a COMPONENT in the `find_package(ITK ...)`

For example here:

> <https://github.com/Slicer/Slicer/blob/322fb8552dd71d6f61b92a89cad4e8aecc102f11/Libs/vtkITK/CMakeLists.txt#L31-L47>

Add

```auto
BioCell

```

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [March 20, 2019, 2:11pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/4 "2019-03-20T14:11:34Z")

</div>

Thanks a lot! I’ll try to do that

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [March 20, 2019, 8:02pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/5 "2019-03-20T20:02:44Z")

</div>

I checked the lib directory again, and found an ‘ITKBioCell-5.0.lib’. The reason it was not found was that the project wanted to find an ‘ITKBioCell.lib’. I’ll work with @gcsharp to fix the Plastimatch build within SlicerRT, and then probably issue a PR to include this remote.  
Thanks!

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [March 21, 2019, 2:08pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/6 "2019-03-21T14:08:39Z")

</div>

Unfortunately there are multiple other errors too when building Plastimatch with ITKv5.

I wish some more testing had been done before making the switch, at least trying to build the most downloaded extensions. Now we have to scrape to have a working SlicerRT, which is by far the most downloaded extension. I already got emails about why it is not available. This is an emergency for us that I think would have been avoidable.

For others struggling with the same thing, here is the ITK 5 migration guide: [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md)

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [March 21, 2019, 2:58pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/7 "2019-03-21T14:58:12Z")

</div>

Nightly Slicer will be unstable for a while due to many major changes that we are planning to do (Python3…). Can your users stay on the latest stable version?

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [March 21, 2019, 3:03pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/8 "2019-03-21T15:03:19Z")

</div>

That’s what I told them. There are not a lot of changes in SlicerRT so they don’t lose much. But we might lose users who try the nightly and they don’t find what they want.

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [May 10, 2019, 11:29pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/9 "2019-05-10T23:29:40Z")

</div>

3 posts were split to a new topic: [Improve description of nightly build on download.slicer.org](https://discourse.slicer.org/t/improve-description-of-nightly-build-on-download-slicer-org/6754)

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [March 21, 2019, 3:28pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/11 "2019-03-21T15:28:48Z")

</div>

After taking a better look, these errors, although there are many, do not seem hard to fix. At least for us what took the long time was to investigate what broke exactly and to find the time to start the fixes (deadlines etc). Doing the fixes should be now easy, and can be expected in a day or two.

I don’t think it is needed to revert the change unless there are multiple other extensions that rely heavily on ITK as much as SlicerRT (due to Plastimatch mainly).

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [March 21, 2019, 3:39pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/12 "2019-03-21T15:39:20Z")

</div>

> [@cpinter](#):
>
> long time was to investigate what broke exactly and to find the time to start the fixes

Based on your finding and implemented fixes, could you add entry to [Documentation/Nightly/Developers/Tutorials/MigrationGuide - Slicer Wiki](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide#Transition_from_ITK4_to_ITK5)

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [May 10, 2019, 11:30pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/14 "2019-05-10T23:30:36Z")

</div>

A post was split to a new topic: [Streamlining maintenance of download.slicer.org](https://discourse.slicer.org/t/streamlining-maintenance-of-download-slicer-org/6755)

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [March 21, 2019, 4:18pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/15 "2019-03-21T16:18:32Z")

</div>

> [@jcfr](#):
>
> Based on your finding and implemented fixes, could you add entry

Some of the things are specific to Plastimatch (e.g. I don’t think anyone else uses BioCell), and I find that ITK migration guide is pretty good. Since there is a link already to the full migration guide I think it is enough.

---

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [March 22, 2019, 3:44pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/16 "2019-03-22T15:44:14Z")

</div>

I just saw this [post about release of ITK 4.13.2](https://discourse.itk.org/t/itk-4-13-2-has-been-released/1696), which made me quite confused about the discussion in this thread. Quoting that post,

> The next feature pre-release for ITK 5, ITK 5 Release Candidate 2, is anticipated in [a few weeks](https://github.com/InsightSoftwareConsortium/ITK/milestone/4)

If ITK 5 is not yet released, we only have release candidate 1, why is Slicer switching to ITK 5 now?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [March 22, 2019, 4:01pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/17 "2019-03-22T16:01:49Z")

</div>

Part of the motivation was that @phcerdan was available to do the troubleshooting for the needed C++ changes. Also this has been [on the roadmap for a long time](https://www.slicer.org/wiki/Documentation/Labs/Slicer5-roadmap) to upgrade all the dependencies and we planned that the nightly would be undergoing a lot of slicer5 changes (python3 is coming soon too) and that was accepted since we have a 4.10.1 already and plans for a 4.10.2 soon for people who aren’t ready to change. I think it’s fine that we are a bit ahead of the game on ITK. I doubt it’ll change much between RC and release.

---

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [March 22, 2019, 4:16pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/18 "2019-03-22T16:16:42Z")

</div>

I think C++ changes is different from upgrading to a dependency that is in a pre-release stage. I did not find ITK 5 upgrade in the roadmap, maybe I missed it. Maybe it all makes sense to the developers closely involved, but for someone a bit on the outside, switch to a prerelease of a key dependency looks strange.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [March 22, 2019, 4:31pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/19 "2019-03-22T16:31:54Z")

</div>

Personally I don’t think it’s strange at all that the pre-release version of Slicer would be using the almost released version of ITK. You are right that the roadmap does not specifically callout ITK5, but it makes it clear that disruptive changes are coming…

---

<div class="post-metadata">

### Author: ![phcerdan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/phcerdan/32/1559_2.png) [@phcerdan](https://discourse.slicer.org/u/phcerdan)
#### Post date: [March 22, 2019, 4:33pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/20 "2019-03-22T16:33:40Z")

</div>

Hi @fedorov, I updated the wiki with the steps taken on the transition. [ITKv4-\>ITKv5](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide#Transition_from_ITK4_to_ITK5) and the [ITKv5 Migration Guide](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md)

Upgrading external modules should be a matter of upgrading to ITKv5 new threads,  
if the ThreadedGenerateData makes no use of `threadId` replacing:

```cpp
void ThreadedGenerateData( const OutputRegionType& threadRegion, ThreadIdType threadId )

```

```cpp
void DynamicThreadedGenerateData( const OutputRegionType& threadRegion )

```

will do.

In other cases, where `threadId` is involved, the ITK migration guide has examples, but to just use the ITKv4 threading system add to the ITK class constructor:

```cpp
this->DynamicMultiThreadingOff();

```

And replace

```auto
  #include <itkMultiThreader.h>

  itk::MultiThreader::Pointer ProcessingThreader;

```

with:

```cpp
  #include <itkPlatformMultiThreader.h>

  itk::PlatformMultiThreader::Pointer ProcessingThreader;

```

that will probably solve 99% of the problems upgrading to ITKv5.

I am sorry the upgrade forced external plugins to catch up…

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [March 22, 2019, 6:20pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/21 "2019-03-22T18:20:45Z")

</div>

I went through the extensions on the latest nightly dashboard that did not build. These are the extensions that fail to build due to ITK and the failure seems to be related to version 5 (and not some older issue like itkFactoryRegistration):

- ABC
- DSCMRIAnalysis
- DTI-Reg
- DTIAtlasBuilder
- DTIProcess
- IASEM
- PET-IndiC
- PETTumorSegmentation
- PkModeling
- ResampleDTIlogEuclidean
- SkullStripper
- SlicerElastix
- SlicerVMTK
- SPHARM
- VirtualFractureReconstruction (also failed before for different reasons)

All of these issues are related to these few things:

- Changed constants such as ITK\_THREAD\_RETURN\_TYPE
- The abovementioned multi-threading changes
- Changed vnl functions (e.g. vnl\_math\_isinf or vnl\_math\_abs)
- Deprecated vcl functions (e.g. vcl\_cstdio.h or vcl\_vector)
- Changed image initialization ( conversion from ‘int’ to ‘const itk::SmartPointer\<itk::Image\<float, 3\> \>’ is ambiguous) - I haven’t met this one when fixing SlicerRT but I think this should be new as well

I volunteer fixing SlicerElastix as I’m planning to work on it regarding the node references I’m adding to all registration modules.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [March 22, 2019, 6:37pm UTC](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214/22 "2019-03-22T18:37:08Z")

</div>

Thanks @cpinter! You probably know this, but @lassoan checked the elastix repo and they were actively porting to itk5 so maybe it’s just a matter of changing the superbuild hash.

[Next page](https://discourse.slicer.org/t/slicerrt-does-not-build-due-to-missing-itk-remote-module/6214.md?page=2)
