GDCMCLEAN(1)
π NAME π
okay so bestie, meet gdcmclean β the main character of this GDCMCLEAN(1) page, living under the DICOM Manipulation umbrella. It is literally the tool to clean a DICOM file. cleaning era β¨
πΈ SYNOPSIS πΈ
gdcmclean [options] file-in file-out
gdcmclean [options] dir-in dir-out
π§Ό DESCRIPTION π§Ό
the gdcmclean tool is a cleaning tool. Thatβs the whole vibe: DICOM goes in, cleaning happens. π«§
π PARAMETERS π
file-inβ DICOM input filenamefile-outβ DICOM output filename
or
file-inβ DICOM input directoryfile-outβ DICOM output directory
β¨ OPTIONS β¨
you need to:
π specific options π
-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.
π Editing mode options π
--emptyβ DICOM tag(s) to empty. the menu is:%d,%dβ DICOM tag(s) to empty%d,%d,%sβ DICOM private tag(s) to empty%sβ DICOM keyword/path(s) to empty
--removeβ DICOM tag(s) to remove. same little menu:%d,%dβ DICOM tag(s) to remove%d,%d,%sβ DICOM private tag(s) to remove%sβ DICOM keyword/path(s) to remove
--scrubβ DICOM tag(s) to scrub. yup, the menu again:%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...).
π 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
π TYPICAL USAGE π
β¨ Editing mode β¨
This functionality is not described in the DICOM standard.
The following example shows how to use editing mode and achieve multiple operations at the same time:
- Preserve illegal attributes (removed by default),
- Empty any
'PN'attributes anywhere in the hierarchy tree, but preserve the DICOM attribute value only at location"0010,0010", - Empty the tag
(0010,0020)Patient ID, (only if keyword is know internally), - Empty the tag
(0070,0084), - 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). - Scrub the private attributes:
(0029,10,SIEMENS CSA HEADER)/(0029,20,SIEMENS CSA HEADER)/(700d,08,TOSHIBA_MEC_MR3)/(0029,90,PMTF INFORMATION DATA)
$ gdcmclean \
--recursive --continue \
--preserve-illegal \
--empty PN --preserve /0010,0010 \
--empty PatientID --empty "0070,0084" \
--remove "0029,20,SIEMENS MEDCOM HEADER" --remove "0033,02,MITRA OBJECT UTF8 ATTRIBUTES 1.0" --remove "0043,2a,GEMS_PARM_01" \
--scrub "0029,10,SIEMENS CSA HEADER" --scrub "0029,20,SIEMENS CSA HEADER" \
--scrub "700d,08,TOSHIBA_MEC_MR3" \
--scrub "0029,90,PMTF INFORMATION DATA" --scrub "0029,90,TOSHIBA_MEC_MR3" \
input_folder output_folder
π¦ DICOM Path π¦
For ease of use on shell command the syntax allow for the '/' separator in the DICOM Path notation. So the following is valid:
"/0040,0100/1/0040,0006"
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):
"\\4109,2,Applicare/Centricity Radiology Web/Version 1.0"
πΈ Safe Private Attributes πΈ
It is currently not possible to empty/remove any private attribute listed in the Safe Private Attributes table at:
https://dicom.nema.org/medical/dicom/current/output/chtml/part15/sect_E.3.10.html#table_E.3.10-1
π SEE ALSO π
gdcmanon(1), gdcmdump(1), gdcmdiff(1)
π AUTHOR π
- Mathieu Malaterre β Main developer
β COPYRIGHT β
Copyright Β© 2006, 2011 Mathieu Malaterre
this page is from GDCM 3.0.24, dated 12/25/2025 β go clean something cute, bestie π β¨
π¦ where this page comes from
- opensuse-leap 16.0: gdcm-applications 3.0.24-bp160.2.1 Β· BSD-3-Clause
- opensuse-leap 16.0: gdcm-applications 3.0.24-bp160.2.1 Β· BSD-3-Clause
- opensuse-leap 16.0: gdcm-applications 3.0.24-bp160.2.1 Β· BSD-3-Clause
- opensuse-leap 16.0: gdcm-applications 3.0.24-bp160.2.1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms