1gdcmraw(1)                           GDCM                           gdcmraw(1)
2
3
4

NAME

6       gdcmraw - Extract Data Element Value Field.
7

SYNOPSIS

9       gdcmraw [options] file-in file-out
10

DESCRIPTION

12       The gdcmraw tool is mostly used for development purpose. It is used to
13       extract a specific binary field from a DICOM DataSet.
14

PARAMETERS

16       file-in   DICOM input filename
17
18       file-out  output filename
19

OPTIONS

21   PARAMETERS
22         -i --input     Input filename
23         -o --output    Output filename
24         -t --tag       Specify tag to extract value from.
25
26   OPTIONS
27         -S --split-frags  Split fragments into multiple files.
28         -p --pattern      Specify trailing file pattern (see split-frags).
29         -P --pixel-data   Pixel Data trailing 0.
30
31   general options
32         -h   --help
33                print this help text and exit
34
35         -v   --version
36                print version information and exit
37
38         -V   --verbose
39                verbose mode (warning+error).
40
41         -W   --warning
42                warning mode, print warning information
43
44         -E   --error
45                error mode, print error information
46
47         -D   --debug
48                debug mode, print debug information
49

Typical usage

51   Copy Attribute Value to file
52       This will extract the value at Tag (0025,101b):
53
54       $ gdcmraw -i GE_MR_0025xx1bProtocolDataBlock.dcm -t 25,101b -o pdb.raw
55
56   Extract Pixel Data
57       If you do not specify any tag, the Pixel Data element is the default
58       one. So for instance to grab the Pixel Data from an image:
59
60       $ gdcmraw -i test.acr -o test.raw
61
62       You can then for example compute the md5sum of this pixel data (very
63       useful):
64
65       $ md5sum test.raw
66       f845c8f283d39a0204c325654493ba53  test.raw
67
68   Encapsulated Syntax
69       When the Pixel Data is encapsulated, multiple fragments can be used to
70       store a single slice image:
71
72       $ gdcmdump D_CLUNIE_CT1_J2KR.dcm
73
74       ...
75       (7fe0,0010) OB                                                    # u/l,1 Pixel Data
76         (fffe,e000) ?? []                           # 0,1 Item
77         (fffe,e000) ?? ff\4f\ff\51\00\29\00\00\00\00\02\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\02\00         # 65536,1 Item
78         (fffe,e000) ?? 2c\b7\ee\68\de\e3\93\2d\b3\b8\ba\90\7b\42\3e\f8\42\16\64\88\46\30\37\d4\50\95\9b\b6\a5\c7\38\9b         # 65536,1 Item
79         (fffe,e000) ?? 48\3c\03\e8\c4\3f\44\e1\8a\5c\73\3b\02\0a\ad\a5\8f\e4\0c\81\76\a2\d7\1b\7f\b7\cd\bc\30\c6\6a\6a         # 43308,1 Item
80       (fffe,e0dd) 0
81
82       In order to create a J2K image out of it, we need to extract each
83       fragments and concatenate them:
84
85       $ gdcmraw -i D_CLUNIE_CT1_J2KR.dcm -o D_CLUNIE_CT1_J2KR.j2k
86
87       This is a valid J2K file, using the Kakadu software package:
88
89       $ kdu_expand -i D_CLUNIE_CT1_J2KR.j2k -o D_CLUNIE_CT1_J2KR.tiff -record D_CLUNIE_CT1_J2KR.txt
90
91       $ cat D_CLUNIE_CT1_J2KR.txt
92
93       Sprofile=PROFILE2
94       Scap=no
95       Sextensions=0
96       Ssize={512,512}
97       Sorigin={0,0}
98       Stiles={512,512}
99       Stile_origin={0,0}
100       Scomponents=1
101       Ssigned=yes
102       Sprecision=16
103       Ssampling={1,1}
104       Sdims={512,512}
105       Cycc=no
106       Cmct=0
107       Clayers=1
108       Cuse_sop=no
109       Cuse_eph=no
110       Corder=LRCP
111       Calign_blk_last={no,no}
112       Clevels=5
113       Cads=0
114       Cdfs=0
115       Cdecomp=B(-:-:-)
116       Creversible=yes
117       Ckernels=W5X3
118       Catk=0
119       Cuse_precincts=no
120       Cblk={64,64}
121       Cmodes=0
122       Qguard=1
123       Qabs_ranges=18,19,19,20,19,19,20,19,19,20,19,19,20,19,19,20
124
125       >> New attributes for tile 0:
126
127   Extract fragments as single file
128       Sometimes each fragments is in fact a single slice, so we would not
129       need to concatenate them:
130
131       $ gdcmdump 00191113.dcm
132
133       ...
134       (7fe0,0010) OB                                                    # u/l,1 Pixel Data
135         (fffe,e000) ?? 00\00\00\00\6b\38\01\00\10\77\02\00\37\b6\03\00\a7\f4\04\00         # 20,1 Item
136         (fffe,e000) ?? ff\d8\ff\c3\00\0b\08\02\00\02\00\01\00\11\00\ff\c4\00\1b\00\01\01\01\01\01\01\01\01\00\00\00\00         # 79970,1 Item
137         (fffe,e000) ?? ff\d8\ff\c3\00\0b\08\02\00\02\00\01\00\11\00\ff\c4\00\1b\00\01\01\01\01\01\01\01\01\00\00\00\00         # 81564,1 Item
138         (fffe,e000) ?? ff\d8\ff\c3\00\0b\08\02\00\02\00\01\00\11\00\ff\c4\00\1b\00\01\01\01\01\01\01\01\01\00\00\00\00         # 81694,1 Item
139         (fffe,e000) ?? ff\d8\ff\c3\00\0b\08\02\00\02\00\01\00\11\00\ff\c4\00\1b\00\01\01\01\01\01\01\01\01\00\00\00\00         # 81511 (81512),1 Item
140       (fffe,e0dd) 0
141
142       Let's try to extract those 4 individual Lossless jpeg individually:
143
144       $ gdcmraw --split-frags -i 00191113.dcm -o jpeg --pattern %02d.ljpeg
145
146       This will output 4 files:
147
148       -rw-r--r--  1 mathieu mathieu   81512 2008-08-08 22:10 jpeg03.ljpeg
149       -rw-r--r--  1 mathieu mathieu   81694 2008-08-08 22:10 jpeg02.ljpeg
150       -rw-r--r--  1 mathieu mathieu   81564 2008-08-08 22:10 jpeg01.ljpeg
151       -rw-r--r--  1 mathieu mathieu   79970 2008-08-08 22:10 jpeg00.ljpeg
152

Footnote about JPEG files

154       It is a common misunderstanding to interchange 'JPEG 8bits lossy' with
155       simply JPEG file. The JPEG specification is much broader than simply
156       the common lossy 8bits file (as found on internet).
157
158       You can have
159
160       · JPEG Lossy 8bits
161       · JPEG Lossy 12bits
162       · JPEG Lossless 2-16bits
163       Those are what is defined in ITU-T T.81, ISO/IEC IS 10918-1.

SEE ALSO

165       gdcmdump(1), gdcmraw(1)
167       Copyright (c) 2006-2010 Mathieu Malaterre
168
169
170
171Version 2.0.16                  Tue Jul 26 2011                     gdcmraw(1)
Impressum