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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16.3 Implement<strong>in</strong>g <strong>DICOM</strong> 327<br />

Fig. 94 Sketch<strong>in</strong>g b<strong>in</strong>ary buffer class implementation. The most typical (<strong>and</strong> efficient<br />

way) is to implement the buffer as an array of (fixed-length) buffer chunks; proper<br />

choice of the chunk size optimizes memory allocations<br />

Fig. 95 Sketch<strong>in</strong>g value representation (VR) class. m_Type member stores VR type<br />

(27 possible types), <strong>and</strong> m_Data holds the attribute data. The ma<strong>in</strong> emphasis <strong>in</strong> VR<br />

implementation is to support all <strong>DICOM</strong> data encod<strong>in</strong>g methods (explicit <strong>and</strong> implicit),<br />

<strong>and</strong> various data types<br />

tags for VR type <strong>and</strong> description should be <strong>in</strong>stantaneous. This is your ma<strong>in</strong><br />

data-typ<strong>in</strong>g tool; all VR types will be retrieved from the Data Dictionary.<br />

5. Write a function that converts your VR <strong>in</strong>to XML <strong>and</strong> reads it back from this<br />

XML object. <strong>DICOM</strong>, <strong>in</strong> many ways, is very XML-like, <strong>and</strong> with XML be<strong>in</strong>g<br />

the dom<strong>in</strong>ant data format these days, convert<strong>in</strong>g <strong>DICOM</strong> data <strong>in</strong>to it <strong>and</strong><br />

back will prove to be extremely useful. In particular, you will need it for<br />

serialization, logg<strong>in</strong>g, <strong>and</strong> database storage.<br />

6. When you f<strong>in</strong>ish your with VRs, proceed to def<strong>in</strong><strong>in</strong>g classes for <strong>DICOM</strong> modules,<br />

IEs, <strong>and</strong> IODs (see 5.7). Code base an abstract class for each <strong>DICOM</strong><br />

module <strong>and</strong> derive specific classes for each particular module type; then use

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

Saved successfully!

Ooh no, something went wrong!