我正在使用DCMTK作为C++项目,并且想要从dicom文件中检索像素。 我用THID基本的例子:DCMTK C++:如何从dicom文件获取数据像素
DicomImage *image = new DicomImage("test.dcm");
if (image != NULL)
{
if (image->getStatus() == EIS_Normal)
{
if (image->isMonochrome())
{
image->setMinMaxWindow();
Uint8 *pixelData = (Uint8 *)(image->getOutputData(8 /* bits */));
if (pixelData != NULL)
{
/* do something useful with the pixel data */
}
}
} else
cerr << "Error: cannot load DICOM image (" << DicomImage::getString(image->getStatus()) << ")" << endl;
}
delete image;
在“做一些与像素数据有用”的部分,怎么用PixelData取出变量获得像素
- 什么是包括上面的代码文件的唯一办法?我无法找到从DICOM文件读取像素数据的完整示例。有人可以帮忙吗? – Ruchir
好吧,明白了。这是dcmimage.h – Ruchir