powershelldicomdcmtk

In Powershell is there a convenient way of dumping all dicom element that belong to group


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} 

Solution

  • 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}'}