Installation

Table of contents

  1. Running DESIGNER v2 using Docker (most convenient)
  2. Installing DESIGNER v2 from source (if you know what you are doing ;))
    1. Install with uv
  3. or

Running DESIGNER v2 using Docker (most convenient)

We provide convenient docker images to quickly get started with Designer without the need to install and its dependencies. Official versions will be tagged (nyudiffusionmri/designer2:<tag>; latest tag is v2.0.17), while we also maintain images following our main development branch (nyudiffusionmri/designer2:main). See Docker Hub for an overview of all releases.

To get started, install Docker Desktop on your machine. If you are using an Apple Silicon device, navigate to the Docker app’s general settings and enable the “Use Rosetta for x86/amd64 emulation on Apple Silicon” option for compatibility. We recommend setting the memory limit to at least 15GB for optimal performance.

Verifying can be done by running docker run nyudiffusionmri/designer2:<tag> designer

You can then start an interactive terminal in your container by running docker run -it nyudiffusionmri/designer2:<tag> /bin/bash

Files can be passed by mounting a local folder into the container: docker run -it -v <path to local folder>:/data nyudiffusionmri/designer2:<tag> /bin/bash. In this case you can run commands in the container directly.

You can also run designer directly on the command line. Any files can be referenced by their absolute path in the container (e.g. /data/<your file>). docker run -it -v <path to local data folder>:/data nyudiffusionmri/designer2:<tag> designer ...

Note that you can replace nyudiffusionmri/designer2:<tag> by any other tag.

For users who are working on HCP servers and cannot use Docker, DESIGNER may also be used with Singularity. The following can be run to singularity-ize our Docker image: singularity pull docker://nyudiffusionmri/designer2:<tag>

We can then run DESIGNER by running: singularity run designer2_<tag>.sif designer...

Installing DESIGNER v2 from source (if you know what you are doing ;))

If running DESIGNER v2 using Docker is not your preferred method, you can install it from source with uv. DESIGNER v2 is no longer distributed on PyPI, so pip install designer2 is not supported. This method requires installing DESIGNER’s external tools on your local machine yourself (see Requirements and Dependencies below), which the Docker image otherwise bundles.

Install with uv

Designer version 2 is written in python and c++ and is an external Mrtrix3 project. Its Python dependencies are pinned in uv.lock, and uv installs them into a project-local virtual environment (.venv).

  1. Install uv.
  2. Clone the repository and install DESIGNER together with its Python dependencies:
    git clone https://github.com/NYU-DiffusionMRI/DESIGNER-v2.git
    cd DESIGNER-v2
    uv sync --locked --no-dev
    

    uv uses the Python version pinned in .python-version (3.12) and downloads it if it is not already installed. uv sync also compiles DESIGNER’s C++ extension (RPG Gibbs correction), which requires a C++ compiler and FFTW (see below).

  3. Run DESIGNER and TMI through uv (inside the project repo), or activate the environment first: ``` uv run designer … uv run tmi …

or

source .venv/bin/activate designer …


{: .warning }
FSL also ships a command named `designer`. Use `uv run designer` or activate `.venv` so that DESIGNER's command takes precedence over FSL's.

To update DESIGNER, pull the latest changes and sync again:

git pull uv sync –locked –no-dev



### Requirements and Dependencies
Currently, installing designer locally requires a source installation of mrtrix3. A future update of the mrtrix3 precompiled binaries may eliminate these requirements, however as of today, users must follow the steps [here](https://mrtrix.readthedocs.io/en/latest/installation/build_from_source.html) to configure and build the source mrtrix3 package. 

Installing the `dev` branch is needed, as there are additional features in `dwifslpreproc` that have no yet made it to the main codebase. The source mrtrix3 installation can be completed by running the following lines after ensuring that mrtrix3 dependencies are installed properly.

git clone https://github.com/MRtrix3/mrtrix3.git cd mrtrix3/ cmake -B build -DCMAKE_INSTALL_PREFIX=/path/to/installation/ cmake –build build cmake –install build


After mrtrix3 has been successfully installed, users should create the `PYTHONPATH` environment variable and link it against the mrtrix3 python libraries:

export PYTHONPATH=</path/to/mrtrix3/lib> ```

For example, if a user clones the mrtrix3 github repository to the directory /usr/local/mrtrix3, they would run the command export PYTHONPATH=/usr/local/mrtrix3/lib. We recommend that users add this line to their .bashrc or .bash_profile so that designer is permanently configured properly in the users shell environment.


Designer also relies on FSL tools for EPI distortion correction and eddy current and motion correction. Users can install FSL here and follow the steps outlined in the FSL documentation.


Depending on the options you use, designer also calls the following external tools, which must be on your PATH:

  • ANTs (e.g. N4BiasFieldCorrection, -ants_motion_correction)
  • TORTOISE CreateGradientNonlinearityBMatrix and CreateNonlinearityDisplacementMap (gradient nonlinearity correction)
  • FreeSurfer’s SynthStrip mri_synthstrip and its model weights, with FREESURFER_HOME set (-skullstrip_backend synthstrip). Its Python dependencies (torch, surfa) are installed by uv sync, so run it from the uv environment.

Building DESIGNER’s C++ extension requires a C++ compiler and FFTW 3 built with thread support (--enable-threads). The build looks for FFTW’s headers in /usr/local/include and its libraries in /usr/local/lib.


All Python dependencies are installed automatically by uv sync from the pinned versions in uv.lock; there is no need to install them yourself or to manage a separate conda or pyenv environment. DESIGNER requires Python 3.10 or newer and is developed and tested with Python 3.12.