Skip to content

Instantly share code, notes, and snippets.

@rrrodrigo
Created June 24, 2013 08:38
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 rrrodrigo/5848605 to your computer and use it in GitHub Desktop.
Save rrrodrigo/5848605 to your computer and use it in GitHub Desktop.
batch conversion of DCM images (medical diagnostics imagery, like MR scans) to JPEG, using ImageMagick
# to make sure a file is a DCM use identify
identify 00000031
00000031 DCM 512x512 512x512+0+0 8-bit sRGB 527KB 0.000u 0:00.000
# then set permissions and rename accordingly
chmod 600 * ; rename 's/(.*)/$1.dcm/' *
# then perform the conversion
mogrify -format jpg *.dcm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment