gdcm2vtk (1) - Linux Manuals

gdcm2vtk: .TH "gdcm2vtk" 1 "Fri Oct 29 2010" "Version 2.0.16" "GDCM"


gdcm2vtk - .TH "gdcm2vtk" 1 "Fri Oct 29 2010" "Version 2.0.16" "GDCM"


gdcm2vtk - .SH "SYNOPSIS"

gdcm2vtk [options] file-in file-out


The gdcm2vtk takes as input any file supported by VTK (including DICOM file) and will generate as output a DICOM file.


file-in   input filename (DICOM or VTK supported)

file-out  DICOM output filename



     --force-rescale    force rescale.
     --force-spacing    force spacing.
     --palette-color    when supported generate a PALETTE COLOR file.
     --argb             when supported generate a ARGB file.
     --compress         when supported generate a compressed file.
     --use-vtkdicom     Use vtkDICOMImageReader (instead of GDCM).
     --modality         set Modality.
  -T --study-uid        Study UID.
  -S --series-uid       Series UID.
     --root-uid         Root UID.

compression options

  -J --jpeg             Compress image in jpeg.
  -K --j2k              Compress image in j2k.
  -L --jpegls           Compress image in jpeg-ls.
  -R --rle              Compress image in rle (lossless only).

general options

  -h   --help
         print this help text and exit

  -v   --version
         print version information and exit

  -V   --verbose
         verbose mode (warning+error).

  -W   --warning
         warning mode, print warning information

  -E   --error
         error mode, print error information

  -D   --debug
         debug mode, print debug information

environment variable



Convert a file supported by VTK into DICOM.

Typical usage is:

$ gdcm2vtk inputfile output.dcm

It uses the internal factory mechanism of VTK to recognize a file (CanRead function). See VTK supported file here:

What image file formats can VTK read and write?

If your input file has 4 components, the 4th comp (alpha) will be removed from the output file as DICOM does not support alpha component anymore (see --argb option).

Special care was taken for the following file format:

   1. DICOM: Direction Cosines and vtkMedicalImageInformation are passed to the output
   2. BMP: The file can be saved with a Lookup Table (see --palette-color)
   3. GE Signa: vtkMedicalImageProperties is passed to the output
   4. MINC: Direction Cosines is passed to the output
   5. TIFF: vtkTIFFReader is currently in bad shape in VTK (different behavior in VTK 5.2 and CVS). Only use it, if you know what you are doing.

CONVERT MetaImage (mhd, mha)

$ gdcm2vtk inputfile output.mha

This command will convert the input DICOM file: inputfile into a MetaImage .mha file. Same goes for .mhd file.


$ gdcm2vtk inputfile output.mha


$ gdcm2vtk inputfile output.mhd

This command will convert the input DICOM file: inputfile into a MetaImageData .mha/.mhd file.


$ gdcm2vtk inputfile output.vti

This command will convert the input DICOM file: inputfile into a XML VTK ImageData .vti file.


$ gdcm2vtk inputfile output.vtk

This command will convert the input DICOM file: inputfile into an old VTK Structured PointSets .vtk file.


$ gdcm2vtk input.dcm output.dcm

vtkGDCMImageReader will be used to read in a DICOM file, not the default vtkDICOMImageReader.

IMPORTANT NOTE: The internal VTK structured will be filled from the input DICOM, and then pass to the output DICOM writer. Some information might be lost during the conversion DICOM to VTK to DICOM. This option is mostly used to test the vtkGDCMImageReader/vtkGDCMImageWriter combination.

IMPORTANT NOTE: When converting from a lossy format such as JPEG, the information of lossiness is important. The output DICOM will contains the required Lossy Image Compression attribute that indicates that image was lossy-compressed somewhere along the pipeline. See also gdcmimg (better handling of JPEG in general).

IMPORTANT NOTE: When using --use-vtkdicom the output DICOM file will always be written as MR Image Storage as this information is not available from the reader itself. This allow setting the Image Orientation (Patient) properly.


Copyright (c) 2006-2010 Mathieu Malaterre


gdcmdump(1), gdcmviewer(1), gdcmimg(1)