DerThorsten / nifty

A nifty library for graph based image segmentation.
MIT License
41 stars 21 forks source link
image-segmentation python segmentation

Github Workflow builds

Build Status

Nifty

A nifty library for 2D and 3D image segmentation, graph based segmentation an opt. This library provided building blocks for segmentation algorithms and complex segmentation pipelines. The core is implemented in C++ but the suggested language to use this library from is python.

Important:

To use nifty one needs to checkout some submodules via:

git submodule init
git submodule update

If WITH_MP_LP is active, one needs:

git submodule update --init --recursive

Documentation:

A very tentative documentation of the nifty python module.

Features (Highlights):

C++ vs Python:

The Python API is at present the easiest to use. The C++ API is mostly for power users. We recommend to use library from Python. Almost any class / function in the Python API is calling into C++ via pybind11.

Install:

Conda:

The easiest way to install this version is via conda (right now it is not available with gurobi or cplex, you will need to build from source for this):

conda install -c conda-forge nifty

From Source:

To build nifty from source, you will need to set up an environment with all necessary dependencies. We recommend to use conda for this as well and provide the file environment.yaml` for this. You can set up this environment and build nifty with the following commands:

$ conda env create -f environment.yaml
$ conda activate nifty-dev
$ mkdir bld
$ cd bld
$ cmake -DCMAKE_PREFIX_PATH=/path/to/conda/envs/nifty-dev -DWITH_Z5=ON -DWITH_HDF5=ON -DWITH_ZLIB=ON -DBUILD_NIFTY_PYTHON=ON ..
$ make

This would build nifty with additional hdf5 and z5 dependencies; and add zlib support for z5. You can find all build options in CMakeLists.txt; note that you may need to install additional dependencies.

Troubleshooting:

TODO

Changelog:

TODO