Skip to content

Instantly share code, notes, and snippets.

View koegl's full-sized avatar

Fryderyk Kögl koegl

  • Brainlab
View GitHub Profile
@koegl
koegl / h5_to_niigz.py
Last active May 6, 2024 11:24
Convert .h5 to .nii.gz
# this snippet shows how to convert a .h5 transformation to a .nii.gz displacement field using the ants python library
# based on this commend https://github.com/ANTsX/ANTs/issues/54#issuecomment-2085595485
# to do this, we need the reference/fixed image and the .h5 transformation
from ants import utils as utils_ants
args = ['-d', '3',
'-r', 'reference.nii.gz',
'-t', 'transform.h5',