Created
February 12, 2020 15:15
-
-
Save ted-strauss-K1/f51fcf329717a4f07f407ac08be5c1f2 to your computer and use it in GitHub Desktop.
sort dicom slices into folders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
find pTIF0002_20200129_161954623/ -type f | while read f; do | |
p=$(dcmdump "$f" | awk '/ProtocolName/{print $3;}' | sed -e 's,\],,g' -e 's,\[,,g') | |
n=$(dcmdump "$f" | awk '/SeriesNumber/{print $3;}' | sed -e 's,\],,g' -e 's,\[,,g') | |
d="$n-$p" | |
mkdir -p $d | |
mv "$f" $d | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment