'\" t
.\"     Title: gdcmclean
.\"    Author: Mathieu Malaterre
.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
.\"      Date: 01/29/2023
.\"    Manual: DICOM Manipulation.
.\"    Source: GDCM 3.0.21
.\"  Language: English
.\"
.TH "GDCMCLEAN" "1" "01/29/2023" "GDCM 3\&.0\&.21" "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"
gdcmclean \- Tool to clean a DICOM file\&.
.SH "SYNOPSIS"
.PP
.if n \{\
.RS 4
.\}
.nf
gdcmclean [options] file\-in file\-out
gdcmclean [options] dir\-in  dir\-out
.fi
.if n \{\
.RE
.\}
.SH "DESCRIPTION"
.PP
The
\fBgdcmclean\fR
tool is an cleaning tool\&.
.SH "PARAMETERS"
.PP
.if n \{\
.RS 4
.\}
.nf
file\-in   DICOM input filename

file\-out  DICOM output filename
.fi
.if n \{\
.RE
.\}
.PP
or
.PP
.if n \{\
.RS 4
.\}
.nf
file\-in   DICOM input directory

file\-out  DICOM output directory
.fi
.if n \{\
.RE
.\}
.SH "OPTIONS"
.PP
You need to :
.SS "specific options"
.PP
.if n \{\
.RS 4
.\}
.nf
  \-i \-\-input                  DICOM filename / directory
  \-o \-\-output                 DICOM filename / directory
  \-r \-\-recursive              recursively process (sub\-)directories\&.
     \-\-continue               Do not stop when file found is not DICOM\&.
.fi
.if n \{\
.RE
.\}
.SS "Editing mode options"
.PP
.if n \{\
.RS 4
.\}
.nf
     \-\-empty    %d,%d         DICOM tag(s) to empty
                %d,%d,%s      DICOM private tag(s) to empty
                %s            DICOM keyword/path(s) to empty
     \-\-remove   %d,%d         DICOM tag(s) to remove
                %d,%d,%s      DICOM private tag(s) to remove
                %s            DICOM keyword/path(s) to remove
     \-\-scrub    %d,%d         DICOM tag(s) to scrub
                %d,%d,%s      DICOM private tag(s) to scrub
                %s            DICOM keyword/path(s) to scrub
     \-\-preserve %s            DICOM path(s) to preserve
     \-\-preserve\-missing\-private\-creator             Whether or not preserve private attributes with missing private creator\&.
     \-\-preserve\-group\-length                        Whether or not preserve deprecated group length attributes (will not be re\-computed)\&.
     \-\-preserve\-illegal                             Whether or not preserve illegal attributes (eg\&. group 0003\&.\&.\&.)\&.
.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
.\}
.SH "TYPICAL USAGE"
.SS "Editing mode"
.PP
This functionality is not described in the DICOM standard\&.
.PP
The following example shows how to use editing mode and achieve multiple operations at the same time:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Preserve illegal attributes (removed by default),
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Empty any \*(AqPN\*(Aq attributes anywhere in the hierarchy tree, but preserve the DICOM attribute value only at location "0010,0010",
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Empty the tag (0010,0020) Patient ID, (only if keyword is know internally),
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Empty the tag (0070,0084),
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Remove the private attributes: (0029,20, SIEMENS MEDCOM HEADER) / (0033,02,MITRA OBJECT UTF8 ATTRIBUTES 1\&.0) / (0043,2a,GEMS_PARM_01)\&. Since (0033,02,MITRA OBJECT UTF8 ATTRIBUTES 1\&.0) is defined internally in the private dictionary with Value Representation = PN, this attribute will be skipped (since redundant)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Scrub the private attributes: (0029,10,SIEMENS CSA HEADER) / (0029,20,SIEMENS CSA HEADER) / (700d,08,TOSHIBA_MEC_MR3) / (0029,90,PMTF INFORMATION DATA)
.RE
.PP
.if n \{\
.RS 4
.\}
.nf
$ gdcmclean \e
    \-\-recursive \-\-continue \e
    \-\-preserve\-illegal \e
    \-\-empty PN \-\-preserve /0010,0010 \e
    \-\-empty PatientID \-\-empty "0070,0084" \e
    \-\-remove "0029,20,SIEMENS MEDCOM HEADER" \-\-remove "0033,02,MITRA OBJECT UTF8 ATTRIBUTES 1\&.0" \-\-remove "0043,2a,GEMS_PARM_01" \e
	\-\-scrub "0029,10,SIEMENS CSA HEADER" \-\-scrub "0029,20,SIEMENS CSA HEADER" \e
	\-\-scrub "700d,08,TOSHIBA_MEC_MR3" \e
	\-\-scrub "0029,90,PMTF INFORMATION DATA" \-\-scrub "0029,90,TOSHIBA_MEC_MR3" \e
    input_folder output_folder
.fi
.if n \{\
.RE
.\}
.SS "DICOM Path"
.PP
For ease of use on shell cmmand the syntax allow for the \*(Aq/\*(Aq separator in the DICOM Path notation\&. So the following is valid
.PP
.if n \{\
.RS 4
.\}
.nf
"/0040,0100/1/0040,0006"
.fi
.if n \{\
.RE
.\}
.PP
However Private Creator can use all of Value Representation LO definition\&. So in some case you will be required to use backslash as separator (since illegal in VR:LO):
.PP
.if n \{\
.RS 4
.\}
.nf
"\e\e4109,2,Applicare/Centricity Radiology Web/Version 1\&.0"
.fi
.if n \{\
.RE
.\}
.SS "Safe Private Attributes"
.PP
It is currently not possible to empty/remove any private attribute listed in the Safe Private Attributes table at:
.PP
\m[blue]\fBhttps://dicom\&.nema\&.org/medical/dicom/current/output/chtml/part15/sect_E\&.3\&.10\&.html#table_E\&.3\&.10\-1\fR\m[]
.SH "SEE ALSO"
.PP
\fBgdcmanon\fR(1),
\fBgdcmdump\fR(1),
\fBgdcmdiff\fR(1)
.SH "AUTHOR"
.PP
\fBMathieu Malaterre\fR
.RS 4
Main developer
.RE
.SH "COPYRIGHT"
.br
Copyright \(co 2006, 2011 Mathieu Malaterre
.br