Question

How can I parse DICOM files in VC++? How to edit the DICOM tags?

Was it helpful?

Solution

If possible, it is better to use some already existing libraries such as MergeCom (not free) or DCMTK. They handle all kinds of conditions such explicit VR, implicit VR, parsing of nested sequence items etc. Take a look at this link regarding the basic structure of a dicom file: Introduction DICOM single file format.

For editing the DICOM file, remember that you might have update the group length tag also. Also, its going to be quite tricky if you want to validate the edited value as there are so many VRs and different IODs have different mandatory and optional tags. So I suggest again to use the existing libraries if possible.

OTHER TIPS

Are you looking for any library that would do it for you? Or you want to write your own? Try DCMTK if you want the first.

Try GDCM, it is even wrapped in C#. It uses CMake, so generation of Visual Studio file is easy.

Ref: http://gdcm.sf.net

As other people suggested there are many 3rd party library available. Although many are paid but nobody will stop you from using trial versions :)

  1. MergeCom (C version, Java Version) Windows/Linux, This is the best one , You will get a lots of sample along with library to learn.

    http://www.mergecom3.com/

  2. DCMTK

    http://dicom.offis.de/dcmtk

  3. DVTK

    http://www.dvtk.org/

  4. Imebra

    http://imebra.com/

  5. GDCM

    http://gdcm.sourceforge.net/wiki/index.php/Main_Page

There are a lot more, needed is you start work on one :)

As posted before, there are many free libraries who would gladly do it for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top