File: Installation.md

package info (click to toggle)
vtk-dicom 0.8.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,032 kB
  • sloc: cpp: 113,806; python: 2,041; makefile: 43; tcl: 10
file content (104 lines) | stat: -rw-r--r-- 3,761 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
## Installation {#installation}

@brief The different ways to install the package.

## Building as part of the VTK build

If are building VTK yourself, then vtk-dicom can be enabled as a VTK
remote module.  This will cause cmake to automatically download the
vtk-dicom source code from Github and build it as part of the VTK build.

To enable vtk-dicom in a VTK 9 build, set this cmake cache variable:

    VTK_MODULE_ENABLE_VTK_vtkDICOM:STRING=WANT

For VTK 7 or 8, use the following cmake cache variable instead:

    Module_vtkDICOM:BOOL=ON

After running cmake once, the following new options will become available:

    BUILD_DICOM_PROGRAMS:BOOL=ON
    USE_GDCM:BOOL=OFF
    USE_ITK_GDCM:BOOL=OFF
    USE_DCMTK:BOOL=OFF

It is highly recommended that you turn the USE_GDCM option ON, otherwise
vtk-dicom will not be able to read compressed dicom files.  This requires
[downloading GDCM from its project website](https://sourceforge.net/projects/gdcm/).

The USE_ITK_GDCM option can be used as an alternative to USE_GDCM if you
are building a program that uses ITK.  With this option, it is not necessary
to build GDCM separately.

USE_DCMTK can be enabled if you cannot use GDCM, but still require the
ability to read compressed files.  Note that the default DCMTK build does
not provide JPEG2000 support, though it can be purchased as an add-on.

## Building outside of VTK

The following procedure can be used to build the vtkDICOM
library, assuming that you have already built VTK with CMake.
This example is for building the package on Linux or OS X in
the bash shell.

    $ # specify the directory where you built VTK, this is an example
    $ export VTK_DIR=/Volumes/HD2/vtk-release-build/
    $ unzip vtk-dicom-master.zip
    $ mkdir vtk-dicom-master-build
    $ cd vtk-dicom-master-build
    $ cmake -D CMAKE_BUILD_TYPE:STRING=Release ../vtk-dicom-master
    $ make

Optionally, the following cmake variables can
be set with ccmake or cmake-gui:

    BUILD_EXAMPLES               ON
    BUILD_PROGRAMS               ON
    BUILD_SHARED_LIBS            OFF
    BUILD_TESTING                ON
    USE_DCMTK                    OFF
    USE_GDCM                     OFF
    USE_ITK_GDCM                 OFF
    VTK_DIR                      /Volumes/HD2/vtk-release-build/

The USE_DCMTK and USE_GDCM variables
allow you to add the image decompression capabilities of either of these
packages (do not specify both!) to the vtkDICOMReader.  If you do not
specify one of these packages, then the vtkDICOMReader will only be
able to read uncompressed files.  See the section above for additional
details on these variables.

## Configuring your own cmake project

The easiest way to use the vtk-dicom library in your own project is
to add the following command block to the main CMakeLists.txt file
in your project:

    find_package(DICOM QUIET)
    set(VTK_DICOM_LIBRARIES vtkDICOM)

For VTK 7 and 8, it is also necessary to include UseDICOM.cmake, as follows:

    find_package(DICOM QUIET)
    if(DICOM_FOUND)
      include(${DICOM_USE_FILE})
    endif()
    set(VTK_DICOM_LIBRARIES vtkDICOM)

It is not recommended to try to use vtk-dicom (or VTK itself)
within projects that are not built with cmake.

## Wrapper languages

All of the vtk-dicom classes can be used with Python, as long as VTK was
built with python wrapping enabled.  Use of vtk-dicom with Tcl and Java is
no longer supported (Java wrapping might still work, but is untested).

If you are already using the vtk .deb packages that came with your
debian or ubuntu linux distribution, then you have the option of using
the vtk-debian packages that were created by Mathieu Malaterre:

    sudo apt-get install python3-vtk-dicom

There are currently no pypi (pip) packages for vtk-dicom.