Skip to content
/ lddmm Public

Large deformation diffeomorphic metric mapping (LDDMM) in PyTorch with KeOps library

License

Notifications You must be signed in to change notification settings

PatRyg99/lddmm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LDDMM with PyTorch and KeOps

Large deformation diffeomorphic metric mapping (LDDMM) in PyTorch with KeOps library.
More friendly wrapper based on this tutorial:
https://www.kernel-operations.io/keops/_auto_tutorials/surface_registration/plot_LDDMM_Surface.html

Installation

Navigate to main direction and run

pip install .

Now you can import lddmm and enjoy.

Getting started

import pyvista as pv
from lddmm.registrator import LDDMMRegistrator

source_mesh = pv.read("<source-mesh-path>")
target_mesh = pv.read("<target-mesh-path>")

# Rigid regsitration
source_mesh.points -= source_mesh.points.mean(axis=0)
target_mesh.points -= target_mesh.points.mean(axis=0)

# Define and run LDDMM registration
registrator = LDDMMRegistrator(source_mesh, target_mesh, sigma=20, device="cpu")
registrator.optimize(2)

Obtaining interpolated deformation timepoints:

# Get raw shooting results
shots = registrator.shoot(nt=15)
# Get shooting results and save as .vtp files
registrator.export_shoot("shots", nt=15)

About

Large deformation diffeomorphic metric mapping (LDDMM) in PyTorch with KeOps library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages