views:

488

answers:

6

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

+2  A: 

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.

Canopus
+5  A: 

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.

Naveen
A: 

As other people suggested there are many 3rd party library available :

Although many are paid but no body stop you 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://puntoexe.com/content/view/11/2/

5) GDCM

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

sat
+1  A: 

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

Ref: http://gdcm.sf.net

malat
Nice thing about GDCM is it is used in ITK
Julien L.
A: 

Hi I am also want to write my own application to read and edit then write back DICOM files without using any third part tools. How can I do that? If anyone of you have samples please share or send it me to the following mail id.It will be very help full for me.

mail id: [email protected]

Sajin M K
A: 

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

Ofek Shilon