15.12.2012 Views

Digital Imaging and Communications in Medicine (DICOM)

Digital Imaging and Communications in Medicine (DICOM)

Digital Imaging and Communications in Medicine (DICOM)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

54<br />

Chapter 5 Parlez-Vous <strong>DICOM</strong>?<br />

Fig. 9 Example of a group length element: element (0010,0000) at the very beg<strong>in</strong>n<strong>in</strong>g<br />

of group 0010 conta<strong>in</strong>s data value equal to L, where L is the total number of bytes <strong>in</strong><br />

the encoded group 0010 data elements (follow<strong>in</strong>g right after element (0010,0000)). The<br />

number of bytes <strong>in</strong> (0010,0000) is not <strong>in</strong>cluded <strong>in</strong> L<br />

The reason for group length encod<strong>in</strong>g is exactly the same as it is for element<br />

length encod<strong>in</strong>g. If your application does not need to read the group gggg data,<br />

it might read only the group’s length L from the (gggg,0000) tag, <strong>and</strong> then fastforward<br />

L bytes, thus proceed<strong>in</strong>g to the next available group. Because the number<br />

of elements <strong>in</strong> gggg can be large, this forward<strong>in</strong>g can substantially speed up<br />

<strong>DICOM</strong> object read<strong>in</strong>g (a technique known as partial pars<strong>in</strong>g). This becomes<br />

particularly h<strong>and</strong>y when deal<strong>in</strong>g with proprietary, odd-numbered groups. Such<br />

groups can be correctly <strong>in</strong>terpreted only by their manufacturers <strong>and</strong> have to be<br />

ignored by everyone else. If group length is provided <strong>in</strong> element (gggg,0000),<br />

skipp<strong>in</strong>g such groups becomes a very easy exercise.<br />

Group length can also be viewed as a basic security feature. Group length<br />

(just like data checksums) makes it harder to modify someth<strong>in</strong>g <strong>in</strong> part of a<br />

<strong>DICOM</strong> object without destroy<strong>in</strong>g the entire object structure. There is no free<br />

lunch, however, <strong>and</strong> this method has its own pr<strong>in</strong>cipal drawback. To be able to<br />

write the (gggg,0000) tag, your software application must know the length L of<br />

all data elements from the gggg group that are present <strong>in</strong> the <strong>DICOM</strong> object.<br />

That is, it needs to know the total length of all gggg elements, which will be<br />

written after the very first (gggg,0000) group length element. This implies that<br />

all gggg elements must already be available to you with their f<strong>in</strong>al values <strong>and</strong><br />

encoded ahead of encod<strong>in</strong>g the (gggg,0000) element. To <strong>DICOM</strong> software developers,<br />

this means two th<strong>in</strong>gs:<br />

1. Writ<strong>in</strong>g <strong>DICOM</strong> objects on-the-fly becomes practically impossible because<br />

all data must be collected first.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!