我有一个 dicom 图像,我使用 DCMTK 将其转换为 tiff 并进行了一些图像处理。我将结果图像保存为 .bmp,但我想知道是否可以将其保存为具有原始源文件所有属性的 .dcm。我的示例代码是:-
// for converting dcm to tiff//
///src_path is the path for the diccom image///
src_dcm = new DicomImage(src_path);
if (src_dcm != NULL)
{
if (src_dcm->getStatus() == EIS_Normal)
{
if (src_dcm->isMonochrome())
{
src_dcm->setMinMaxWindow();
Uint8 *pixelData = (Uint8 *)(src_dcm->getOutputData(16 /* bits */));
if (pixelData != NULL)
{
src_dcm->writeBMP("source.tiff",24); /* do something useful with the pixel data */
}
}
}
else
cerr << "Error: cannot load DICOM image (" << DicomImage::getString(src_dcm->getStatus()) << ")" << endl;
}
处理后,我在 IplImage* 掩码中有结果图像。我现在将其保存为 .bmp 但我想将其保存为 .dcm 并具有源 dicom 图像的所有属性(实例编号、xy 列等)。