Installation

See below for installation instructions

1. Pre-requisites

On Ubuntu, you could install the pre-reqs with:

$ apt-get install -y openslide-tools python-openslide default-jre

2. Clone Git Repo

Clone the public repository:

$ git clone git://github.com/msk-mind/luna

3. Install Python Dependencies and Luna Packages

First, update your pip and install numpy:

$ pip install --upgrade pip
$ pip install numpy # pyradiomics installation fails if numpy is not installed

Note

for pyluna-* packages that are not on pypi, add your local path in setup.cfg for installation to work correctly.

For example, modify absolute-path-to-luna-repo and update your setup.cfgs with:

pyluna-radiology @ file://localhost/absolute-path-to-luna-repo/pyluna-radiology/

To install luna and its basic functionality, run this command in your terminal:

$ pip install .

To install luna subpackages, with more features specify a subpackage {radiology, pathology} or install all with .[all] to installl all features. For example, to install luna pathology, run this command:

$ pip install .[pathology]

Check that your installation was successful in Python shell.

>> import luna

3.1 Development Mode

For development mode, install [dev] extras that includes dependencies for testing the code and generating documentation.

$ pip install .[dev]

Alternatively, you can install python dependencies from the requirements_dev.txt and setup $PYTHONPATH

$ pip install -r requirements_dev.txt

3.2 Development with Docker

luna-dev docker image is available on DockerHub.

This docker image includes the pre-requisites and python dependencies. This is primarily used for circleci testing at the moment, but can be extended based on your development needs.

Once we have a stable release, docker images that includes pyluna packages can be made available.

4. Setup PYTHONPATH and LUNA_HOME

In luna repo, run:

$ . setup_local.sh

Running the setup_local script will:

  1. Add local luna packages to $PYTHONPATH, so you can import luna packages in dev mode.

  2. Set $LUNA_HOME as the current directory. Steps to setup configuration files in $LUNA_HOME/conf are detailed in the Configuration section.

5. Setup Configuration

Currently, we have two configuration files.

  • datastore.cfg: configuration for the backend store of your data. POSIX and Minio backends are supported.

  • logging.cfg: configuration for logging level and optional central logging in MongoDB.

In $LUNA_HOME/conf/ folder, copy logging.default.yml to logging.cfg and datastore.default.yml to datastore.cfg and modify the .cfg files.

$ cd $LUNA_HOME/conf
$ cp logging.default.yml logging.cfg
$ cp datastore.default.yml datastore.cfg

[Future] Stable Release

To install luna and its basic functionality, run this command in your terminal:

$ pip install pyluna

To install luna subpackages, with more features specify a subpackage {common, radiology, pathology} or install all with pyluna[all]. For example, to install luna pathology, run this command:

$ pip install pyluna[pathology]

This is the preferred method to install luna, as it will always install the most recent stable release.

If you don’t have pip installed, this Python installation guide can guide you through the process.

JupyterLab Installation Tutorial

This notebook tutorial will go help you setup your luna virtual environment in Jupyterlab.