Reputation: 2830
I need to read the raw measurement data from DICOM files into 2D double-arrays using C++. It becomes clear that DICOM is actually a rather extensive file format, and I tried to use the DCMTK library but couldn't even compile it successfully.
Since I do not need all the features DICOM offers (almost none), I would like to know if there are easy to use/install libraries out there (probably really limited in their functionality) that can load a DICOM file for me into a double-array. It would also be great, if this was a header-only solution I could simply include, instead of something I have to be able to compile first.
I am currently working on a Win64 machine, but right now my C++ code is platform independent and I would like to keep it that way.
If what I am asking is actually not available I would also accept a (reference to a) very good step-by-step installation description of one of the more complicated libraries out there as 'the easiest way'.
Upvotes: 0
Views: 1235
Reputation: 12506
There is no open-source header-only C/C++ library for dealing with DICOM. You may want to dig into:
You can have a loop at the simpliest API in GDCM: gdcm::ImageReader, see here.
If you are using python, GDCM offers a python binding, and you can simply import the image array as a numpy array (see here).
If you are not afraid of using VTK, there is also vtkDICOMImageReader or vtk-dicom.
Upvotes: 2