我正在使用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