Skip to content

Instantly share code, notes, and snippets.

@arthurcgusmao
Last active January 29, 2019 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthurcgusmao/8e24c1bd253cb24ca03123b60d58dc61 to your computer and use it in GitHub Desktop.
Save arthurcgusmao/8e24c1bd253cb24ca03123b60d58dc61 to your computer and use it in GitHub Desktop.
Convert .dcm files to .jpg shell script / command line
#!/bin/bash
EXTENSION=.dcm
FILES=*/*.dcm
mkdir outputs
for f in $FILES
do
echo "Converting $f file..."
fname="$(basename $f $EXTENSION)"
dcmj2pnm $f outputs/$fname.jpg +oj
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment