You can download the latest stable release of Nighres from PyPI.
Because parts of the package have to be built locally it is currently not possible to use
pip install directly from PyPI. Instead, please download and unpack the tarball to Build Nighres. (Or use the Docker image)
You can also get the latest version from Github
git clone https://github.com/nighres/nighres
Or download and unpack the zip file from Github under Clone and download -> Download ZIP
Make sure you have JCC installed. You need to both get the package via your package manager and install using pip to make it accessible to the Python interpreter, e.g:
sudo apt-get install jcc pip install jcc
Navigate to the Nighres directory you downloaded (and unpacked) and run the build script:
The build might take a while because it pulls the original Java code from https://github.com/piloubazin/cbstools-public and builds the wrappers using JCC.
Install the Python package:
pip install .
Testing the installation¶
You can often catch installation problems by simply import Nighres in Python. Make sure to navigate out of the directory from which you installed to make sure Nighres has actually been installed correctly and can be accessed from any location
python -c "import nighres"
If that works, you can try running one of the examples. You can find them inside the unpacked Nighres directory, in the subdirectory examples. Alternatively, you can also download the examples from the online documentation.
To build Nighres you need:
- Java, a version that is 1.7 or higher
To run Nighres depends on:
If not already available, these packages are automatically installed when you run pip install.
Check and include version dependencies
To quickly try out nighres in a preset, batteries-included environment, you can use the included Dockerfile, which includes Ubuntu 14 Trusty, openJDK-8, nighres, and Jupyter Notebook. The only thing you need to install is Docker, a lightweight container platform that runs on Linux, Windows and Mac OS X.
To build the Docker image, do the following:
git clone https://github.com/nighres/nighres cd nighres docker build . -t nighres
To run the Docker container:
docker run --rm -p 8888:8888 nighres
Now go with your browser to https://localhost:8888 to start a notebook. You should be able to import nighres by entering:
into the first cell of your notebook.
Usually you also want to have access to some data when you run nighres. You can grant the Docker container access to a data folder on your host OS by using the -v tag when you start the container:
docker run --rm -v /home/me/my_data:/data -p 8888:8888 nighres
Now, in your notebook you will be able to access your data on the path /data
Additional dependencies (optional)¶
Plotting in the examples
- Nilearn and its dependencies, if Nilearn is not installed, plotting in the examples will be skipped and you can view the results in any other nifti viewer
Building the documentation
- sphinx-rtd-theme (pip install sphinx-rtd-theme)
- pillow (pip install pillow)
Using the docker image