1GDCM2VTK(1) DICOM Manipulation. GDCM2VTK(1)
2
3
4
6 gdcm2vtk - Convert a file supported by VTK into DICOM.
7
9 gdcm2vtk [options] file-in file-out
10
12 The gdcm2vtk takes as input any file supported by VTK (including DICOM
13 file) and will generate as output a DICOM file.
14
16 file-in input filename (DICOM or VTK supported)
17
18 file-out output filename (DICOM or VTK supported)
19
21 specific options
22 --force-rescale force rescale.
23 --force-spacing force spacing.
24 --palette-color when supported generate a PALETTE COLOR file.
25 --argb when supported generate a ARGB file.
26 --compress when supported generate a compressed file.
27 --use-vtkdicom Use vtkDICOMImageReader (instead of GDCM).
28 --modality set Modality.
29 --lower-left set lower left.
30 --shift set shift.
31 --scale set scale.
32 --compress set compression (MetaIO).
33 -T --study-uid Study UID.
34 -S --series-uid Series UID.
35 --root-uid Root UID.
36
37 compression options
38 -J --jpeg Compress image in jpeg.
39 -K --j2k Compress image in j2k.
40 -L --jpegls Compress image in jpeg-ls.
41 -R --rle Compress image in rle (lossless only).
42
43 general options
44 -h --help
45 print this help text and exit
46
47 -v --version
48 print version information and exit
49
50 -V --verbose
51 verbose mode (warning+error).
52
53 -W --warning
54 warning mode, print warning information
55
56 -E --error
57 error mode, print error information
58
59 -D --debug
60 debug mode, print debug information
61
62 environment variable
63 GDCM_ROOT_UID Root UID
64
66 Convert a file supported by VTK into DICOM.
67
68 Typical usage is:
69
70 $ gdcm2vtk inputfile output.dcm
71
72 It uses the internal factory mechanism of VTK to recognize a file
73 (CanRead function). See VTK supported file here:
74
75 What image file formats can VTK read and write? http://www.vtk.org/Wiki/VTK_FAQ#What_image_file_formats_can_VTK_read_and_write.3F
76
77 If your input file has 4 components, the 4th comp (alpha) will be
78 removed from the output file as DICOM does not support alpha component
79 anymore (see –argb option).
80
81 Special care was taken for the following file format:
82
83 1. DICOM: Direction Cosines and vtkMedicalImageInformation are passed to the output
84 2. BMP: The file can be saved with a Lookup Table (see --palette-color)
85 3. GE Signa: vtkMedicalImageProperties is passed to the output
86 4. MINC: Direction Cosines is passed to the output
87 5. TIFF: vtkTIFFReader is currently in bad shape in VTK (different behavior in VTK 5.2 and git/master). Only use it, if you know what you are doing.
88
89 CONVERT MetaImage (mhd, mha)
90 $ gdcm2vtk inputfile output.mha
91
92 This command will convert the input DICOM file: inputfile into a
93 MetaImage .mha file. Same goes for .mhd file.
94
95 CONVERT MHA/MHD
96 $ gdcm2vtk inputfile output.mha
97
98 or
99
100 $ gdcm2vtk inputfile output.mhd
101
102 This command will convert the input DICOM file: inputfile into a
103 MetaImageData .mha/.mhd file.
104
105 CONVERT VTI
106 $ gdcm2vtk inputfile output.vti
107
108 This command will convert the input DICOM file: inputfile into a XML
109 VTK ImageData .vti file.
110
111 CONVERT VTK
112 $ gdcm2vtk inputfile output.vtk
113
114 This command will convert the input DICOM file: inputfile into an old
115 VTK Structured PointSets .vtk file.
116
118 $ gdcm2vtk input.dcm output.dcm
119
120 vtkGDCMImageReader will be used to read in a DICOM file, not the
121 default vtkDICOMImageReader. See option –use-vtkdicom to use
122 vtkDICOMImageReader.
123
125 $ gdcm2vtk input_ybr.dcm output.mhd
126 $ gdcm2vtk --modality US --imageformat 7 output.mhd output.dcm
127
128 The above refsection shows how to convert a DICOM using the Photometric
129 Interpretation of YBR_FULL (or even YBR_FULL_422 is lossy) into another
130 file format: MetaImage (mhd). Since this file format does not handle
131 color space, we have to explicitly set it using the –imageformat
132 command line option. The –modality command line option is required in
133 this case since the default Secondary Capture Image Storage Class
134 family does not allow for YBR Photometric Interpretation.
135
137 IMPORTANT NOTE: The internal VTK structured will be filled from the
138 input DICOM, and then pass to the output DICOM writer. Some information
139 might be lost during the conversion DICOM to VTK to DICOM. This option
140 is mostly used to test the vtkGDCMImageReader/vtkGDCMImageWriter
141 combination.
142
143 IMPORTANT NOTE: When converting from a lossy format such as JPEG, the
144 information of lossiness is important. The output DICOM will contains
145 the required Lossy Image Compression attribute that indicates that
146 image was lossy-compressed somewhere along the pipeline. See also
147 gdcmimg (better handling of JPEG in general).
148
149 IMPORTANT NOTE: When using –use-vtkdicom the output DICOM file will
150 always be written as MR Image Storage as this information is not
151 available from the reader itself. This allow setting the Image
152 Orientation (Patient) properly.
153
155 gdcmdump(1), gdcmviewer(1), gdcmimg(1)
156
158 Mathieu Malaterre
159 Main developer
160
162 Copyright © 2006, 2011 Mathieu Malaterre
163
164
165
166GDCM 2.8.9 11/23/2019 GDCM2VTK(1)