2

I am working in powerwshell and I am wondering if there is a way that I can dump all tags that belong to a group. For instance, if I know there is a Private Creator tag at (0029,0010) is there something in the tool kit that will dump all tags that are (0029,10xx)

hoping that is it something like this

gci -Path "path_to_dcm_file" | %{dcmdump (0029,10**) $_.FullName} 
Doug Maurer
  • 8,090
  • 3
  • 12
  • 13
franklinCat
  • 103
  • 7

1 Answers1

2

Looking at the help for dcmdump it appears the option you are after is +P

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

However for the 10xx part, I couldn't figure out a way to use wildcard in the tag search. You could use powershell for that by printing all tags and then filtering with powershell.

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

or if you wanted to match more than just the last 2 numbers

Get-ChildItem -Path "path_to_dcm_file" |
    ForEach-Object {dcmdump.exe $_.FullName | Select-String '0029,\d{4}'}
Doug Maurer
  • 8,090
  • 3
  • 12
  • 13
  • 1
    I was wrong, I tried it out and wasn't getting any results, but I noticed that I had the -s in place with the dcmdump. After I removed that flag your example did work. I removed my incorrect comment. – franklinCat Oct 12 '20 at 19:01
  • I wondered where it went! lol no worries, do you think this is an acceptable solution? – Doug Maurer Oct 12 '20 at 19:28
  • Yes, your suggestions put me on the right path to solve my issue. Thank You. – franklinCat Oct 12 '20 at 19:53
  • I work with dental offices and I had no clue about tags in dicom files, so thank you as well for teaching me something new! – Doug Maurer Oct 12 '20 at 19:54
  • dcmdump does not support wildcards for DICOM tags unless you want to modify the source code. I think the approach would be dumping the whole file but filtering the output (lines) matching the wildcard tag. – Markus Sabin Oct 13 '20 at 05:05