0

我有一个 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 列等)。

4

1 回答 1

0

基本上, DicomImage 类的目的是图像处理和渲染(如文档所述)。因此,我通常建议使用“dcmdata”模块(而不是“dcmimgle/dcmimage”)提供的功能。但是, DicomImage::writeFrameToDataset()DicomImage::writeImageToDataset()有一些帮助程序。

于 2016-02-09T15:56:26.780 回答