I know there are a few libraries available. But I have to write my own parser for it. I am an amateur. How do I go about tackling this? What things should I know before trying to write my own parser?
Asked
Active
Viewed 311 times
-1
-
1I'm afraid this question is a little bit too broad. With google I found [DICOM Specification Overview](https://www.leadtools.com/sdk/medical/dicom-spec) which seems (at the first glance) to provide a description down to the bytes. As you probably know this (or something comparable), so what's the actual problem? I would take this description and start the work. (If possible it will be helpful to have an exisiting tool at hand so that you can compare your own "parse" results with them of that.) – Scheff's Cat Jul 06 '17 at 05:37
1 Answers
1
You should know about the DICOM rules for building objects (so-called IODs) and encoding rules for attributes. Then a few rules on file encoding apply, which you should also know. The DICOM cookbook is a good starting point to familiarize with the terms and principles of the standard.
However, I agree to @Amit Joshi, that I would advise against writing a parser from scratch - there are many good toolkits around, some of them are for free. Especially the encoding rules are not trivial and require a lot of effor to cover all cases (e.g. Transfer Syntaxes, Sequence encoding).

Markus Sabin
- 3,916
- 14
- 32
-
I actually just want the parser to extrapolate some tags and attributes ignoring all the pixel data of the image. Would the process still be that complicated? – Bored Philosopher Jul 11 '17 at 04:50
-
That depends whether you want to support images of one particular manufacturer / device or if you want to be open for any image. Still I wonder which benefit you expect from doing it on your own rather than using something which is already there and proved to be working fine. – Markus Sabin Jul 11 '17 at 05:38
-
I only have to extrapolate attributes from one manufacturer. How should I go about it? – Bored Philosopher Jul 11 '17 at 06:13
-
Well, my recommendation would be to use DCMTK: https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwip2aXw0YDVAhUJLVAKHUQCDlMQFggnMAA&url=http%3A%2F%2Fdicom.offis.de%2Fdcmtk.php.de&usg=AFQjCNHFaiTtTj3PWnaaE0pyO6yBuJLqXw – Markus Sabin Jul 11 '17 at 06:50