josemanuel097 / WORC

Workflow for Optimal Radiomics Classification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

WORC v1.0.0

Workflow for Optimal Radiomics Classification

This is an open-source python package for the easy execution of full Radiomics pipelines.

We aim to establish a common Radiomics platform supporting easy integration of other tools. With our modular build and support of different software languages (python, MATLAB, ruby, java etc.), we want to facilitate and stimulate collaboration and comparison of different Radiomics approaches. By combining this in a single framework, we hope to find a universal Radiomics strategy that can address various problems.

Disclaimer

This package is under heavy development. We try to thoroughly test and evaluate every new build and function, but bugs can off course still occur. Please create an issue on Github or contact us through the channels below if you find any. We will try to fix them as soon as possible.

Documentation

More detailed information can be found in the Wiki on this Github repository.

Alternatively, you can generate the documentation by checking out the master branch and running from the root directory:

python setup.py build_sphinx

The documentation can then be viewed in a browser by opening PACKAGE_ROOT\build\sphinx\html\index.html.

Installation

WORC has currently only been tested on Unix with Python 2.7. The package can be installed by cloning the repository and executing:

  python setup.py install

The installation will create a FASTR configuration file in the ~/.fastr/config.d folder. Please inspect the mounts and change them if neccesary. More information can be found at the FASTR website

Several tools have some prerequisites which are listed below. We highly recommend you to install these to maximally profit from our toolbox.

ITK and ITK tools

We use the ITKtools toolbox for the conversion between different image types, which is by default embedded in the toolbox. As ITKtools requires you to build ITK, you should do this first. PATH should be equal to your fastr.config.mounts['apps'] path.

On Linux, we provide a script for automatic installation. Simply run: """ ./install_ITK.sh """

On Windows/MacOSx, follow the steps below.

  1. Obtain the ITK sources, compile and install
wget http://downloads.sourceforge.net/project/itk/itk/4.10/InsightToolkit-4.10.1.tar.gz?r=https%3A%2F%2Fitk.org%2FITK%2Fresources%2Fsoftware.html&ts=1477129065&use_mirror=kent PATH/ITK/itk.tar.gz
mkdir PATH/ITK/ITK-src/ && tar -xzf PATH/ITK/itk.tar.gz -C PATH/ITK/ITK-src/ --strip-components=1
cd PATH/ITK/ITK-bin/
cmake -DModule_ITKReview=ON -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF PATH/ITK/ITK-src
make

Alternative version:

git clone https://itk.org/ITK.git
mkdir ITK-build
cd ITK-build
cmake ../ITK
make
  1. Obtain and build ITKtools
mkdir PATH/itktools
cd PATH/itktools
wget https://github.com/ITKTools/ITKTools/archive/master.zip
unzip master.zip
rsync -a ITKTools-master/ 0.3.2 && rm -rf ITKTools-master
mkdir 0.3.2/install && cd 0.3.2/install
cmake ../src -DITK_DIR=PATH/ITK/ITK-bin/
make

Elastix

Image registration is included in WORC through elastix and transformix. Download the binaries and, similar to ITKtools, place them in the fastr.config.mounts['apps'] path. Check the elastix tool description for the correct subdirectory structure. For example, on Linux, the binaries and libraries should be in "../apps/elastix/4.8/install/" and "../apps/elastix/4.8/install/lib" respectively.

XNAT

We use the XNATpy package to connect the toolbox to XNAT online database platforms. We advise you to specify your account settings in a .netrc file when using this feature, such that you do not need to input them on every request:

echo "machine images.xnat.org
>     login admin
>     password admin" > ~/.netrc
chmod 600 ~/.netrc

FASTR

If you are using FASTR < 1.3.0, you need to manually add the WORC tools, datatypes and mounts to your FASTR configuration (~/.fastr/config.py). The mounts are used by WORC to look for input data, external applications such as ITK tools and save output to. The tools and types path need to be expended to add those from WORC to FASTR.

This concerns the following additions:

import site

# Add the WORC FASTR tools and type paths
packagedir = site.getsitepackages()[0]
tools_path = [os.path.join(packagedir, 'WORC', 'resources', 'fastr_tools')] + tools_path
types_path = [os.path.join(packagedir, 'WORC', 'resources', 'fastr_types')] + types_path

# Mounts accessible to fastr virtual file system
mounts['worc_example_data'] = os.path.join(packagedir, 'WORC', 'exampledata')
mounts['apps'] = os.path.expanduser(os.path.join('~', 'apps'))
mounts['output'] = os.path.expanduser(os.path.join('~', 'WORC', 'output'))
mounts['test'] = os.path.join(packagedir, 'WORC', 'resources', 'fastr_tests')

Note that the Python site package does not work properly in virtual environments. You must then manually locate the packagedir, which on Ubuntu is probably located at \usr\local\lib\python2.7\site-packages.

3rd-party packages used in WORC:

  • FASTR (Workflow design and building)
  • xnatpy (Collecting data from XNAT)
  • SimpleITK (Image loading and preprocessing)
  • Pyradiomics (Feature extractor)

Also, the PREDICT(Feature extractor and classification) package is used, which currently needs to be installed manually from the PREDICT Github repository.

See also the requirements file.

Start

We provide an example script for you to get started with. Make sure you input your own data as the sources. Also, check out the unit tests of several tools in the WORC/resources/fastr_tests directory.

WIP

  • WORC and PREDICT will be uploaded to pip soon.
  • We are working on improving the documentation with a readthedocs.io.
  • We are working on the addition of different classifiers.
  • Examples on open source data and unit tests will be added in the near future.
  • We have some issues with installing numpy and scipy in the requirements. There is now a workaround implemented.

License

This package is covered by the open source APACHE 2.0 License.

Contact

We are happy to help you with any questions. Please contact us on the WORC email list.

We welcome contributions to WORC. We will soon make some guidelines. For the moment, converting your toolbox into a tool wrapper for FASTR will be satisfactory.

About

Workflow for Optimal Radiomics Classification

License:Other


Languages

Language:Python 100.0%Language:Shell 0.0%