Coder Social home page Coder Social logo

oikosohn / slicerdockers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pieper/slicerdockers

0.0 0.0 0.0 33.06 MB

docker config files for slicer

License: Other

Shell 0.13% JavaScript 0.57% C++ 0.01% Python 0.02% C 0.09% Emacs Lisp 0.08% Fortran 0.01% Tcl 0.02% CSS 0.11% Cuda 0.01% HTML 73.17% CMake 16.15% Genshi 0.02% Batchfile 0.01% M4 0.01% Dockerfile 0.06% Roff 9.28% Vim Script 0.26%

slicerdockers's Introduction

These are the docker configuration files to make a baseline user environment for 3D Slicer.

It includes:

  • base: a gui-less debian with file management via webdav
  • x11: a basic gui environment with noVNC
  • slicer-dev: pre-installed developer environment to build Slicer
  • slicer: a binary distribution version of Slicer you can connect to
  • slicer-chronicle: an example of a customized slicer

The build.sh script shows how to make the dockers (change the account from stevepieper to your docker hub name)

Then run the container with a command like this:

docker run -d -p 8080:8080 --name slicer stevepieper/slicer:5.0.3

then open localhost:8080 in your browser and click the "X11 Session" button.

Close the container down again with:

docker rm -f slicer

The push.sh script sends the new images to hub.docker.com.

Running a Slicer analysis script in an instance

The script below can be run in an instance and can be used as a template for more sophisticated analysis scripts.

"""
Here's a simple proof of concept example to run a slicer based script
in a docker instance.

Note that this runs in a full virtualized desktop envionment, so anything
that works in Slicer on a desktop should also work in the docker instance,
including rendering operations.

First create a directory called /tmp/shared that will serve as the bridge
between the host and the instance.

Then copy this file myScript.py into /tmp/shared

Run this script with a command like the following:

docker run -v /tmp/shared:/tmp/shared -p 8080:8080 --rm -it --env SLICER_ARGUMENTS="--python-script /tmp/shared/myScript.py" stevepieper/slicer

it should print some diagnostic info and then exit.

After it runs you will have a copy of the MRHead.nrrd sample data in the /tmp/shared directory.
"""

# as an example, download data and save it locally
import SampleData
mrHeadVolume = SampleData.downloadSample("MRHead")
slicer.util.saveNode(mrHeadVolume, "/tmp/MRHead-from-docker.nrrd")

import os

# use sudo to copy into the shared folder
os.system("sudo cp /tmp/MRHead-from-docker.nrrd /tmp/shared/MRHead-from-docker.nrrd")

# gracefully shut down the docker instance
os.system('sudo kill -s SIGTERM 1')

slicerdockers's People

Contributors

pieper avatar nadya-58 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.