Created
February 16, 2022 23:40
-
-
Save jasonklotzer/809ac9d8e87d34c49a6f87b9765bdfb2 to your computer and use it in GitHub Desktop.
Wrapper script for docker based invocation of DCMTK and DCM4CHE for DICOM tool usage
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 | |
[ $# -lt 2 ] && { echo "Usage: $0 dcmtk|dcm4che arguments"; exit 1; } | |
IMAGE_ALIAS=$1 | |
case $IMAGE_ALIAS in | |
dcmtk) | |
IMAGE="imbio/dcmtk" | |
;; | |
dcm4che) | |
IMAGE="dcm4che/dcm4che-tools" | |
;; | |
*) | |
echo "Image alias not defined: ${IMAGE_ALIAS}" | |
exit 1 | |
;; | |
esac | |
shift # already processed image name | |
docker run -v ${PWD}:/data -w /data --rm ${IMAGE} $@ | |
# TODO: Return exit code from container? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment