DIPimage User Manual » Installing DIPimage

This toolbox requires MATLAB R2008a (version 7.6) or later, though some functionality might require newer versions. The official distributions are compiled with much more recent versions of MATLAB and do not run on earlier versions. The download page on GitHub should specify the versions of MATLAB a specific distribution is compatible with.

You can choose to install the toolbox from source, or download the binary.

On all platforms, it is possible to have multiple versions of DIPimage installed (this is not true for versions of DIPimage before 3.0). But you can only add one of them to your MATLAB path.

Windows installation

Installation from binary distribution

To install DIPimage, simply run the installation program and follow the directions in it. The tool will tell you to start MATLAB and type the command

run('C:\Program Files\dip\dipstart.m')

where C:\Program Files\dip\ is the directory to which you installed DIPimage. The script dipstart.m, executed this way, contains three commands needed to initialise the toolbox (two if you didn’t install the images). These must be executed every time you start MATLAB. You can modify (or create) a file startup.m in the directory to which MATLAB starts up, to contain the run command above. The script startup.m is executed automatically every time MATLAB starts.

Installation from source

Clone the git repository (or download a ZIP file) from GitHub. Read Building the DIPlib project on Windows for step-by-step instructions to build DIPimage, including how to obtain the necessary tools and dependencies.

Once all the binaries are compiled, start MATLAB and type:

addpath('C:\dip\share\DIPimage')
setenv('PATH',['C:\dip\bin',';',getenv('PATH')]);

assuming that C:\dip\ was the root directory where the binaries were installed to.

UNIX/Linux installation

Installation from binary distribution

Installation from source

Clone the git repository (or download a ZIP file) from GitHub. You will require a C++14 compiler (GCC and Clang are available on all platforms), and CMake.

Read Building the DIPlib project on Linux for detailed directions on compiling, including how to get the required build tools and optional dependencies. In principle it should suffice to open a terminal and type the following commands:

git clone https://github.com/DIPlib/diplib.git
mkdir diplib/target
cd diplib/target
cmake ..
make -j install

If you wish to install DIPimage in your home directory instead of /usr, the cmake command could be:

cmake .. -DCMAKE_INSTALL_PREFIX=$HOME

Note that you need to have MATLAB installed on the build machine to build DIPimage. If CMake cannot find your MATLAB installation, add -DMatlab_ROOT_DIR=/path/to/matlab to the CMake command line. You can get the MATLAB root directory by typing matlabroot at the MATLAB command prompt.

Once all the binaries are compiled, start MATLAB and type:

addpath('/usr/local/share/DIPimage')

or:

addpath('/home/uname/share/DIPimage')

depending on where DIPimage was installed to.

You can add this line to your startup.m file (preferably in $HOME/matlab/).

MacOS installation

Installation from binary distribution

Installation from source

Building from source under macOS is very similar to Linux, see the directions in Installation from source, but refer to Building the DIPlib project on macOS instead.