Project

General

Profile

Howto: Extract element values from dcmdump's textual output

Here is an example that shows how to use ''sed'' to extract element values from the dcmdump output:

dcmdump -M +T text.dcm +P PatientID +P StudyDate +P PatientName -s | sed -e "/[/s/.*[(.*)]/1/" -e "s/^(.*(no value available))$//" 

The output might look like the following (the StudyDate is empty in this example - second line):

PATID

Lastname^Firstname

Please note that the above listed regular expression (sed) only extracts character string element values from dcmdump's textual output, i.e. no numerical data.