Skip to content

Instantly share code, notes, and snippets.

@gireeshkbogu
Last active April 11, 2020 21:40
Show Gist options
  • Save gireeshkbogu/94a3b1dd223b340e22d7c0c89cb7e8c3 to your computer and use it in GitHub Desktop.
Save gireeshkbogu/94a3b1dd223b340e22d7c0c89cb7e8c3 to your computer and use it in GitHub Desktop.
Converts .nii format to .jpg or .png format
# source: https://pypi.org/project/med2image/
# https://stackoverflow.com/questions/29640641/how-to-convert-nii-format-file-into-2d-image
# requirements
#pip3 install pydicom
#pip3 install med2image
#pip3 install pudb
#pip3 install pfmisc
#$1 = input.nii
#$2 = output
#$3 = image
#$4 = png
# converts nii to 2D image format
med2image --inputFile $1 --outputDir $2 --outputFileStem $3 --outputFileType $4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment