我可以使用什么 C++ 库从 DICOM 图像中读取像素?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/662591/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What C++ library can I use to read pixels from DICOM images?
提问by Nick Bolton
In C++ I want to read individual pixel values from DICOM images.
在 C++ 中,我想从 DICOM 图像中读取单个像素值。
回答by Ofek Shilon
There are in fact quite a fewfree libraries. If you prefer a higher-level COM envelope and are willing to purchase it, there are a few others - I'm familiar with RZDCXand DicomObjects, and googling around will get you some others.
实际上有很多免费的图书馆。如果您更喜欢更高级别的 COM 信封并愿意购买它,那么还有一些其他的 - 我熟悉RZDCX和DicomObjects,并且谷歌搜索会为您提供一些其他的。
It's reasonably easy to access pixel values under the free DCMTK. If you want the raw Hounsfield data look here, and if you need the post-LUT (e.g., windowing) values - you can use DicomImage::getOutputData.
在免费的 DCMTK 下访问像素值相当容易。如果您想要原始 Hounsfield 数据,请查看此处,并且如果您需要 LUT 后(例如,窗口)值 - 您可以使用DicomImage::getOutputData。
回答by Budric
There this library: http://dicom.offis.de/dcmtk
有这个图书馆:http: //dicom.offis.de/dcmtk
回答by Nick Bolton
If you're using x86 or x86_64, then the imebra library works well. When on x86_64 you need to use the -m32 argument with g++ so that it compiles as a 32-bit. However you will not be able to compile this on IA-64, as the -m32 argument is not supported.
如果您使用的是 x86 或 x86_64,那么 imebra 库运行良好。在 x86_64 上时,您需要将 -m32 参数与 g++ 一起使用,以便它编译为 32 位。但是,您将无法在 IA-64 上编译它,因为不支持 -m32 参数。
The library has a dicom2jpeg program which is useful as an example (but doesn't show you how to read pixel values).
该库有一个 dicom2jpeg 程序,作为示例很有用(但没有向您展示如何读取像素值)。
If you want to read individual pixels, then read this page from the manual: http://imebra.com/documentation/html/quick_tour.html
如果您想读取单个像素,请从手册中阅读此页面:http: //imebra.com/documentation/html/quick_tour.html
回答by malat
You should use GDCM.
您应该使用 GDCM。
Grassroots DiCoM is a C++ library for DICOM medical files. It is automatically wrapped to python/C#/Java (using swig). It supports RAW,JPEG (lossy/lossless),J2K,JPEG-LS,RLE and deflated.
Grassroots DiCoM 是一个用于 DICOM 医疗文件的 C++ 库。它会自动包装到 python/C#/Java(使用 swig)。它支持 RAW、JPEG(有损/无损)、J2K、JPEG-LS、RLE 和放气。
It is portable and is known to run on most system (Win32, linux, MacOSX).
它是可移植的,并且可以在大多数系统(Win32、linux、MacOSX)上运行。