# Building vtk 8.2 with VTKDicom in C++

**URL:** <https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762>\
**Category:** Development\
**Created:** [December 1, 2020, 4:35pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762 "2020-12-01T16:35:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 1, 2020, 4:35pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/1 "2020-12-01T16:35:10Z")

</div>

I had this working before 😑 …

I modified a version of FourPaneViewer, QtVTKRenderWindows to use David Gobbi’s VTKDicom so that it would read compressed DICOM files. I’m also using vtk version 8.2 and GDCM.

I had this working 6 months ago, but after using CMake and VS to rebuild everything on another developer’s station, I can no longer get the decompression to work. Obviously there something I don’t know about integrating the VTKDicom libs. Any ideas about what the differences are between builds?

Thanks

---

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 1, 2020, 4:39pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/2 "2020-12-01T16:39:29Z")

</div>

Is this CMake issue? If so, what did I miss in CMake?

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [December 1, 2020, 4:41pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/3 "2020-12-01T16:41:29Z")

</div>

Hi Doug, for decompression vtk-dicom requires GDCM. After building GDCM, turn on the cmake USE\_GDCM option for vtk-dicom and re-configure.

Note: if you mention me in a post (`@dgobbi`) then discourse will automatically notify me by email.

---

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 1, 2020, 4:47pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/4 "2020-12-01T16:47:56Z")

</div>

OK, thanks David. Appreciate it!

---

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 1, 2020, 5:01pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/5 "2020-12-01T17:01:48Z")

</div>

@dgobbi, after building vtk 8.2, vtkdicom and GDCM, I copied the build folders and files to a file share and then ran CMake for the FourPaneViewer on another computer using the vtk 8.2, vtkdicom and GDCM builds on the file share. Will this work or Is it necessary to perform all of the builds on the same system on which I am CMaking and building the QtVTKRenderWindows app?

---

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 1, 2020, 5:02pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/6 "2020-12-01T17:02:40Z")

</div>

Just trying to make it easy for other developers to build only the QT app

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [December 1, 2020, 5:13pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/7 "2020-12-01T17:13:41Z")

</div>

I’ve never tried putting the build files on a share, so take anything that I say here with a big grain of salt. In general, installing onto a share will work (i.e. use the INSTALL target to install the libraries and headers). However, the build files themselves should not be shared.

---

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 1, 2020, 5:52pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/8 "2020-12-01T17:52:23Z")

</div>

> [@dgobbi](#):
>
> the INSTALL target?

Is that a CMake paramenter?

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [December 1, 2020, 6:02pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/9 "2020-12-01T18:02:29Z")

</div>

No, it will be a target (aka project) within the visual studio solution that cmake generates.

In visual studio, “ALL\_BUILD” will compile the code and “INSTALL” will install the programs/libraries/headers/etc into the location given by the CMAKE\_INSTALL\_PREFIX (which defaults to “`C:\Program Files`” if I’m remembering correctly).

---

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 2, 2020, 7:03pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/10 "2020-12-02T19:03:49Z")

</div>

@dgobbi OK, thank you David, I’m good now. Finally have everything compiled and running.

---

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 2, 2020, 7:22pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/11 "2020-12-02T19:22:23Z")

</div>

@dgobbi - David, you mentioned in a previous response that with a few lines of Python, Splicer could perform the functions of the FourPaneViewer app that I posted a demo of earlier. I am dying to know how that is possible. I installed the latest version of Python yesterday and started playing around with the examples in the document that you referenced. Any more specific info that you could provide would be helpful. The 2 functionalities I will be looking for will be:

1. Oblique slicing with thick slicing and orientation labels on each of the 3 orthogonal views
2. Image co-registration and Fusion

Will this be possible? Or am I asking too much? Thanks.

---

<div class="post-metadata">

**Author:** ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)\
**Post date:** [December 2, 2020, 8:06pm UTC](https://discourse.vtk.org/t/building-vtk-8-2-with-vtkdicom-in-c/4762/12 "2020-12-02T20:06:17Z")

</div>

@dgobbi Hey David, I think I posted that last one on the wrong thread Sorry.
