Medical Image Analysis using Python and Docker
Rudolph Pienaar, PhD
Staff Scientist, Boston Children's Hospital
rudolph.pienaar@childrens.harvard.edu
the view from 30,000 feet...
or 10,000m :-)
http://book.orthanc-server.com/users/docker.html
# Run the Orthanc PACS container
docker run -p 4242:4242 -p 8042:8042 --rm \
-v ~/research/chris/data/orthanc-db/:/var/lib/orthanc/db/ \
jodogne/orthanc-plugins
# Run the "FNNDSC" ubuntu container
docker run -v /Users:/Users -it ubuntu-fnndsc
# On first setup, create group and user:
addgroup --gid 1102 fnndsc
adduser --disabled-password --gecos '' --uid 6244 --gid 1102 rudolph
# exit
exit
# "commit" the changes in this dock:
docker ps -a
docker commit 3f06ea36c5ad ubuntu-fnndsc
# Now run the container again, and connect tunnels...
docker run -v /Users:/Users -it ubuntu-fnndsc
# connect a forward tunnel from 4242 in the dock to the host 4242
ssh -g -f -N -X -L 4242:localhost:4242 rudolph.pienaar@172.16.32.31
# Now, goto some dir containing DCM files on the host FS
cd someDir
# and transmit them via the tunnel to the Orthanc dock!
dicom_dirSend.bash -v 10 -a rudolph -h localhost -p 4242 -E dcm [a-z]* [A-Z]*
# For kicks, attach to the Orthanc dock
docker ps
docker exec -i -t e99a7e5897dd /bin/bash
# Run the web server container
docker run -d -p 8000:80 nginx
# Connect to this container and look at the html dir...
docker exec -it <ID> /bin/bash
# The nginx html dir is
cd /usr/share/nginx/html
# exit the container
exit
# and map a local dir "over" this one
docker run -d -p 8000:80 \
-v ~/research/chris/web/:/usr/share/nginx/html/ \
--name webserver nginx
# Run the ubuntu dock with port forwarding for the ipython notebook
docker run -v /Users:/Users \
-p 8888:8888 -p 8000:80 \
-it ubuntu-fnndsc
# Now run the ipython notebook in the dock
ipython3 notebook --ip="*"
# and connect to it from the host on localhost:8888
# useful cleanup!
docker rm -v $(docker ps -a -q -f status=exited)