Python

Python environments and packages supported/hosted by QIM

Python installations can be “a bit messy” as the development is community driven and can be hard to maintain centrally. What is described here are the environments and packages that QIM provides to everyone through a commonly accessible Conda installation. It might not suit the particular need for a particular project or user, and as such we encourage that project specific Conda installations and environments are created and used (see the Conda page). Alternatively, it is possible to use centrally installed Python modules (see the Modules page).

Starting the QIM-Conda

In order to activate the QIM miniconda installation in the current terminal session (and only here) do the following. This will launch Conda in the base environment.

  • Launch a terminal on the desired node type
  • Navigate to the 3DIM folder:
  • cd /dtu/3d-imaging-center/QIM/conda/
  • Launch the activation shell script:
  • . conda_init.sh
💡 Shortcut option: There is also a shortcut option, although the difference is minor. From a terminal with /dtu/3d-imaging-center/ as the current directory call . shortcuts/conda.sh. Remember that the terminal has auto-completion with the Tab-key.

QIM-Conda Environments

The QIM-Conda currently hosts the following list of environments:

  • qim3d
  • env-viz
  • dvc-spam
  • (cil) (not currently)
  • (qim-phase) (not currently)

Either of them can be activated by calling: conda activate [ENV_NAME]

For a full list of the packages installed within each environment call: conda list, but otherwise a brief description is given for each of them below

NB: The environments here will be updated regularly to support the newest versions of various libraries, packages and programs. They are therefore subject to change and modification without warnings. We strive to make functions and libraries backward compatible, but no guarantees can be given.

# – Base – #
The base environment has very little installed and is essentially just a starting hub. It does has Anaconda Navigator which gives a more graphical interface to switching, investigating and interacting with the environments.

# – qim3d – #
The qim3d environment holds the qim3d library. This has specialized functions and GUIs as documented here, as well as the the most general/basic packages and libraries for working with 3D volumes, and the formats coming out of the scanners at the 3D Imaging Center, e.g.

  • numpy, scikit-image, …
  • nibabel, dxchange, …
  • Editors and IDEs: jupyter-notebook, jupyter-lab

# – CIL – #
The Core Imaging Library is a tomographic reconstruction project. It offers a variety of more advanced reconstruction methods, than what is available on the commercial scanner systems at the 3D Imaging Center.

💡 CIL Tutorials: The official jupyter-notebook tutorials are available at /dtu/3d-imaging-center/QIM/tutorials/CIL-demos.

# – QIM-viz – #
Hold 3rd-party visualization software:

  • Paraview, Tomviz
  • FIJI (ImageJ)

# – QIM-phase – #
Packages for phase-retrieval

Tips and tricks for Python