Skip to content

Running InVesalius 3 in Windows

Victor Hugo Souza edited this page Mar 24, 2022 · 22 revisions

Windows (tested on Windows 10 64 bits)

The packages required by InVesalius can be installed either through a Python system installation or using the Anaconda package manager. In both cases, the following prerequisites apply:

Prerequisites

  • Visual Studio (We are using the 2019 community edition).
    • It's possible to install using chocolatey:
       choco install -y visualstudio2019buildtools
       choco install -y visualstudio2019-workload-vctools
  • Download InVesalius source code.
    git clone --recurse-submodules https://github.com/invesalius/invesalius3

Python installation

Python system installation

  1. Download and install Python 3.8 from the Python website.

  2. Install InVesalius main dependencies (WXPython, numpy, scipy, scikit-image, ImageIO, H5Py, Pillow, Pyserial, PSUtil, nibabel, configparser, PyPubsub, plaidml and Cython) using pip:

pip install -r requirements.txt
  1. If you are going to use the neuronavigation features install the wrappers to the tracking devices:
pip install pyclaron polhemusFT polhemus pypolaris pypolarisP4
  1. Optional: To take advantage of the real-time tractography computation during neuronavigation, the package Trekker is required. The following command downloads and install the pre-generated wheel for Python 3.7:
pip install https://github.com/dmritrekker/trekker/raw/master/binaries/Trekker-0.9-cp38-cp38-win_amd64.whl

Anaconda installation

  1. Install Anaconda, preferably the 64-bit version.

  2. In the Anaconda Powershell, navigate to the cloned invesalius source code folder, for example:

cd C:\Users\%USERNAME%\repository\invesalius3\
  1. Install the required packages with the following command:
conda env create -f environment.yml --name invesalius

This will create a virtual environment named invesalius. To activate it:

conda activate invesalius

Compiling InVesalius

Some algorithms of InVesalius are written in Cython for performance. It's needed to compile them. Open the command prompt of your Visual Studio and go to the InVesalius source code directory, then compile using this command:

python setup.py build_ext --inplace

Running InVesalius:

Inside InVesalius source code directory run:

python app.py

⚠️ If using Anaconda, remember to always open the Anaconda Powershell and activate the environment before running the above command.