简体   繁体   English

使用DCMTK从现有DICOM文件创建新的DICOM文件

[英]creating a new DICOM file from existing DICOM file using DCMTK

I am trying to create a new DICOM file from an existing DICOM file. 我试图从现有的DICOM文件创建一个新的DICOM文件。 So, the scenario is that I have a DICOM file and I do some image processing on it and produce a transformed/processed file and I would like to save it using the original file as a template. 因此,方案是我有一个DICOM文件,并对它进行了一些图像处理,并生成了一个经过转换/处理的文件,我想使用原始文件作为模板来保存它。

The only things that change are 唯一改变的是

1: The pixel data 1:像素数据

2: The rescale and offset tags. 2:重新缩放和偏移标签。

Does anyone know how I can achieve this with DCMTK? 有谁知道我如何使用DCMTK实现这一目标? I looked at various examples but most of them show how to save a JPG or BMP image into a new DICOM file. 我查看了各种示例,但大多数示例都说明了如何将JPG或BMP图像保存到新的DICOM文件中。

If you modify the image data (Pixel Data), you should save the new dataset with new Series Instance UID and SOP Instance UID. 如果修改图像数据(像素数据),则应使用新的系列实例UID和SOP实例UID保存新的数据集。 In addition, you should also update the first value of Image Type (0008, 0008) to “DERIVED” to reflect that image is not the original image. 此外,还应将“图像类型”的第一个值(0008,0008)更新为“派生”,以反映该图像不是原始图像。 The second value Image Type tag can be “PRIMARY” or “SECONDARY” depending on the patient examination characteristics. 第二值图像类型标签可以是“主要”或“次要”,具体取决于患者的检查特征。 You can also use Derivation Description (0008, 2111) and Derivation Code Sequence (0008,9215) to describe the way in which the image was derived. 您还可以使用“派生描述”(0008,2111)和“派生代码序列”(0008,9215)来描述派生图像的方式。 In addition, you can also reference the source image(s) used to create the Derived image by adding optional Source Image Sequence (0008,2112) which can hold a list of Referenced SOP Class UID (0008,1150)/ Referenced SOP Instance UID (0008,1150) pair(s). 此外,您还可以通过添加可选的源图像序列(0008,2112)来引用用于创建派生图像的源图像,该序列可以保存参考SOP类UID(0008,1150)/参考SOP实例UID的列表。 (0008,1150)对。

For anything but pixel data dcmodify is the tool of your choice. 除像素数据外,dcmodify是您选择的工具。

For the pixel data you can use dcmdump to extract the pixel data to a RAW file, change it and use dump2dcm to re-integrate it into the DICOM file 对于像素数据,您可以使用dcmdump将像素数据提取到RAW文件中,进行更改,然后使用dump2dcm将其重新集成到DICOM文件中

Kinldy检查dcmodify可执行文件并检查命令中的help,它具有修改标签的选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM