我将 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 变量来获取像素