在Powershell中,有一种方便的方法可以转储属于组的所有dicom元素



我在powerwshell工作,我想知道是否有一种方法可以转储属于一个组的所有标签。例如,如果我知道(00290010(有一个Private Creator标签,工具包中是否有东西会转储所有(0029,10xx(标签

希望是像这个

gci -Path "path_to_dcm_file" | %{dcmdump (0029,10**) $_.FullName} 

查看dcmdump的帮助,您想要的选项似乎是+P

Get-ChildItem -Path "path_to_dcm_file" |
ForEach-Object {dcmdump.exe +P 0029,0010 $_.FullName}

然而,对于10xx部分,我想不出在标签搜索中使用通配符的方法。您可以使用powershell打印所有标签,然后使用powershell进行过滤。

Get-ChildItem -Path "path_to_dcm_file" |
ForEach-Object {dcmdump.exe $_.FullName | Select-String '0029,10??'}

或者如果你想匹配的不仅仅是最后两个数字

Get-ChildItem -Path "path_to_dcm_file" |
ForEach-Object {dcmdump.exe $_.FullName | Select-String '0029,d{4}'}

相关内容

最新更新