Skip to main content

Efficient and flexible optimization of metamorphoses in images

Project description

Demeter Metamorphosis - 0.2.4

(DiffEoMorphic METamorphic Regristration)

Package status : alpha. see Documentation slides

LDDMM visualisation on a 3D brain

Demeter_metamorphosis is a library intended to perform Metamorphosis on images. It can perform efficient registration of images in 2D and 3D with or without topology differences. We propose a flexible framework to perform Metamorphosis with differents modeling choices. Are provided:

  • The classic LDDMM registration method for registering image having the same topologies as described by Trouvé et al. or Beg's 2005 paper.
  • The classic Metamorphosis registration method for mixing diffeomorphic transport with intensities additions as described in Younes's book "Shape and Diffeomorphisms" (2019).
  • A Weighted Metamorphosis registration method to control the intensity addition locally as described by me in this paper
  • A Constrained Metamorphosis registration method to control the intensity addition locally and guide the registration with a pre-computed vector field as described by me in my thesis. (paper comming soon)
  • and more to come...

The library is designed to be flexible and allow the user to define custom data cost functions, custom norms on the residual, custom vector fields, and custom geodesic integrators. Feel free to contact me through github Issues if you have any questions or need help with the library.

Why the name Demeter ? Because in ancient Rome, Demeter was the goddess of agriculture. Isn't it the perfect protection for or vectors fields ?

The Metamorphic framework [Holm et al., 2009; Trouvé and Younes, 2005; Younes, 2019] can be seen as a relaxed version of LDDMM in which we add time-varying intensity variations are added to the diffeomorphic flow, therefore allowing for topological changes. The image evolution is not only modelled by deformation, we allow adding intensity at each time for every voxel, making topological changes possible. Metamorphosis is solved through an Hamiltonian formulation and the momentum control both the deformation and the intensity changes.

You can find more information on the documentation but also follow a rapid introduction in the following slides: slides

Installation

At the moment, demeter-metamorphosis is available on linux and macOS only. Windows user can use the WSL to install the package.

WSL setup (for Windows users):

WSL is a compatibility layer for running Linux binary executables natively on Windows 10 and Windows Server 2019. It is a feature of the Windows operating system that allows you to run a Linux distribution directly on Windows without using a virtual machine or container. So first install WSL and then you can follow the Unix installation steps.

Install wsl:

 wsl --install

You might need to restart your computer to finish the installation process.

Open a terminal wsl. After the installation is completed, open wsl, set up a password.

sudo apt update
sudo apt install python3-pip
sudo apt install python3.12-venv

For Unix systems, (Linux and macOS)

First I advise you to create a fresh virtual environment with conda or venv. With venv more...:

conda create -n demeter_env python=3.12
conda activate demeter_env

OR conda

python3.12 -m venv "demeter_env"
source "demeter_env"/bin/activate

The last line activate the virtual environment. Please ensure that you are in the virtual environment when you are using the package.

You are now ready to install the package. For a direct usage of demeter you can install the package with pip, if you want to have a

From pip

pip install demeter-metamorphosis

From source

If you want the development version or consider contributing to the codebase, you can also install scikit-shapes locally from a clone of the repository.

Then clone the repository with one of the github provided methods. For example, with html:

git clone https://github.com/antonfrancois/Demeter_metamorphosis.git

Finally navigate to the cloned repository and install the package with

cd Your/path/to/Demeter_metamorphosis
pip install -e .

The whole process can take up to 10 minutes depending on your internet connection, mainly because of the torch and nvidia driver installation.

Examples. and Jupyter Notebooks

You can see results and usage examples in the examples folder or at the [Example Gallery](https://antonfrancois.github.io/Demeter_metamorphosis/auto_examples/index.html:

Location where are stored the saved optimisation results

Demeter allows you to save registration results as metamorphosis objects to be able to reuse, restart, visualize, or analyze the results later. By default, we store them in the ~/.local/share/Demeter_metamorphosis/ folder on linux (may wary on other platforms). You can change the default location by setting the DEMETER_OPTIM_SAVE_DIR environment variable. in the .env file. To locate it you can use the following commands: (in a python file or in a ipython terminal)

import demeter
demeter.display_env_help()

Contact

You can email me at anton.francois [at] ens-paris-saclay.fr or check my website : antonfrancois.github.io/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

demeter_metamorphosis-0.2.4.tar.gz (112.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

demeter_metamorphosis-0.2.4-py3-none-any.whl (111.8 kB view details)

Uploaded Python 3

File details

Details for the file demeter_metamorphosis-0.2.4.tar.gz.

File metadata

  • Download URL: demeter_metamorphosis-0.2.4.tar.gz
  • Upload date:
  • Size: 112.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for demeter_metamorphosis-0.2.4.tar.gz
Algorithm Hash digest
SHA256 e533a3fcbf093e56698ca830c20106fb0aed79cceba56154a337734149afdaa7
MD5 128c60ff6471bdf07469e6551eb0e051
BLAKE2b-256 ad4907917f84d521f02ef5bd6b9e49cf93f7813c540cbe308d0b2286755afb3a

See more details on using hashes here.

File details

Details for the file demeter_metamorphosis-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for demeter_metamorphosis-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b30a107da945a7ecffbfc1ece072329d2399fdb9b3d64b297135eb8ae773d283
MD5 1c6dd4e101e79dea7d54d98343e945ca
BLAKE2b-256 5b2cccc77a644185e39d8092d0bb465efd50de3b27be833a62966f600d087d2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page