'\" t .\" Title: gdcm2vtk .\" Author: Mathieu Malaterre .\" Generator: DocBook XSL Stylesheets v1.79.2 .\" Date: 07/31/2021 .\" Manual: DICOM Manipulation. .\" Source: GDCM 3.0.8 .\" Language: English .\" .TH "GDCM2VTK" "1" "07/31/2021" "GDCM 3\&.0\&.8" "DICOM Manipulation\&." .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" gdcm2vtk \- Convert a file supported by VTK into DICOM\&. .SH "SYNOPSIS" .PP .if n \{\ .RS 4 .\} .nf gdcm2vtk [options] file\-in file\-out .fi .if n \{\ .RE .\} .SH "DESCRIPTION" .PP The \fBgdcm2vtk\fR takes as input any file supported by VTK (including DICOM file) and will generate as output a DICOM file\&. .SH "PARAMETERS" .PP .if n \{\ .RS 4 .\} .nf file\-in input filename (DICOM or VTK supported) file\-out output filename (DICOM or VTK supported) .fi .if n \{\ .RE .\} .SH "OPTIONS" .SS "specific options" .PP .if n \{\ .RS 4 .\} .nf \-\-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\&. \-\-lower\-left set lower left\&. \-\-shift set shift\&. \-\-scale set scale\&. \-\-compress set compression (MetaIO)\&. \-T \-\-study\-uid Study UID\&. \-S \-\-series\-uid Series UID\&. \-\-root\-uid Root UID\&. .fi .if n \{\ .RE .\} .SS "compression options" .PP .if n \{\ .RS 4 .\} .nf \-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)\&. .fi .if n \{\ .RE .\} .SS "general options" .PP .if n \{\ .RS 4 .\} .nf \-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 .fi .if n \{\ .RE .\} .SS "environment variable" .PP .if n \{\ .RS 4 .\} .nf GDCM_ROOT_UID Root UID .fi .if n \{\ .RE .\} .SH "DESCRIPTION" .PP Convert a file supported by VTK into DICOM\&. .PP Typical usage is: .PP .if n \{\ .RS 4 .\} .nf $ gdcm2vtk inputfile output\&.dcm .fi .if n \{\ .RE .\} .PP It uses the internal factory mechanism of VTK to recognize a file (CanRead function)\&. See VTK supported file here: .sp .if n \{\ .RS 4 .\} .nf 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 .fi .if n \{\ .RE .\} .PP 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 \(enargb option)\&. .PP Special care was taken for the following file format: .PP .if n \{\ .RS 4 .\} .nf 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 git/master)\&. Only use it, if you know what you are doing\&. .fi .if n \{\ .RE .\} .SS "CONVERT MetaImage (mhd, mha)" .PP .if n \{\ .RS 4 .\} .nf $ gdcm2vtk inputfile output\&.mha .fi .if n \{\ .RE .\} .PP This command will convert the input DICOM file: inputfile into a MetaImage \&.mha file\&. Same goes for \&.mhd file\&. .SS "CONVERT MHA/MHD" .PP .if n \{\ .RS 4 .\} .nf $ gdcm2vtk inputfile output\&.mha .fi .if n \{\ .RE .\} .sp or .sp .if n \{\ .RS 4 .\} .nf $ gdcm2vtk inputfile output\&.mhd .fi .if n \{\ .RE .\} .PP This command will convert the input DICOM file: inputfile into a MetaImageData \&.mha/\&.mhd file\&. .SS "CONVERT VTI" .PP .if n \{\ .RS 4 .\} .nf $ gdcm2vtk inputfile output\&.vti .fi .if n \{\ .RE .\} .PP This command will convert the input DICOM file: inputfile into a XML VTK ImageData \&.vti file\&. .SS "CONVERT VTK" .PP .if n \{\ .RS 4 .\} .nf $ gdcm2vtk inputfile output\&.vtk .fi .if n \{\ .RE .\} .PP This command will convert the input DICOM file: inputfile into an old VTK Structured PointSets \&.vtk file\&. .SH "CONVERT DICOM" .PP .if n \{\ .RS 4 .\} .nf $ gdcm2vtk input\&.dcm output\&.dcm .fi .if n \{\ .RE .\} .PP \fIvtkGDCMImageReader\fR will be used to read in a DICOM file, not the default vtkDICOMImageReader\&. See option \(enuse\-vtkdicom to use vtkDICOMImageReader\&. .SH "ROUNDTRIP DICOM TO MHD TO DICOM" .PP .if n \{\ .RS 4 .\} .nf $ gdcm2vtk input_ybr\&.dcm output\&.mhd $ gdcm2vtk \-\-modality US \-\-imageformat 7 output\&.mhd output\&.dcm .fi .if n \{\ .RE .\} .PP The above refsection shows how to convert a DICOM using the Photometric Interpretation of YBR_FULL (or even YBR_FULL_422 is lossy) into another file format: MetaImage (mhd)\&. Since this file format does not handle color space, we have to explicitly set it using the \(enimageformat command line option\&. The \(enmodality command line option is required in this case since the default Secondary Capture Image Storage Class family does not allow for YBR Photometric Interpretation\&. .SH "GDCM2VTK NOTES" .PP 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\&. .PP 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)\&. .PP IMPORTANT NOTE: When using \(enuse\-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\&. .SH "SEE ALSO" .PP \fBgdcmdump\fR(1), \fBgdcmviewer\fR(1), \fBgdcmimg\fR(1) .SH "AUTHOR" .PP \fBMathieu Malaterre\fR .RS 4 Main developer .RE .SH "COPYRIGHT" .br Copyright \(co 2006, 2011 Mathieu Malaterre .br