如何更新 DICOM 研究的所有 UID,同时保持其结构?
我有一个 3 系列的 DICOM 研究,想要刷新它的 UID(StudyInstanceUID、SeriesInstanceUID、SOPInstanceUID)来进行一些测试。所有数据都在一个目录中,因此无法判断哪个 DICOM 属于哪个系列。
我尝试过使用 dcmodify (dcmtk) 和一些生成选项:
dcmodify mydirectory/*.dcm -gst -gse -gin
但它使所有单个文件进行不同的研究,结构被破坏。
有没有办法做到这一点,或者我是否必须使用其他 dcmtk 工具来识别每个文件都有的系列 UID?
I have a DICOM study with 3 series and want to refresh its UIDs (StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID) to do some tests. All the data is in a single directory so it's not possible to tell which DICOM belongs to which series.
What I have tried is using dcmodify (dcmtk) with some generate options :
dcmodify mydirectory/*.dcm -gst -gse -gin
but it makes all single files different studies, the structure was broken.
Is there a way to do this or do I have to use other dcmtk tools to identify series UIDs that every single file has?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为每个匹配 mydirectory/*.dcm 的单独图像创建一个新的研究、系列和 SOP 实例 UID,从而破坏您已经观察到的研究/系列结构。
答案有两个:
要将相同的 UID 分配给所有图像,您宁愿使用
(此示例为研究实例 UID),
但据我所知,DCMTK 中没有命令行工具可以完全解决您的问题。 storecp 可以选择为每个研究创建子目录(例如
--sort-on-study-uid
),但这并不能解决系列级别的问题。通过 DCMTK 的方法,我认为您需要使用 dcmdump 来完成一些脚本工作,将文件转储为文本,从中提取 Study- 和 Series 实例 UID,然后将文件移动到适当的位置。研究+系列文件夹。
Create a new Study-, Series and SOP Instance UID for each individual image matching mydirectory/*.dcm, hence destroying the study/series structure as you already observed.
The answer is two-fold:
To assign the same UID to all images, you rather use
(this example for the Study Instance UID)
But there is no command line tool in DCMTK that I am aware of which would completely solve your problem. The storescp has an option to create subdirectories for each study (e.g.
--sort-on-study-uid
) but that does not solve the series-level problem.With the means of DCMTK, I think you need to do some scripting work around it using
dcmdump
to dump the files to text, extracting Study- and Series Instance UID from it and then moving the file to an appropriate Study+Series folder.