# How to import slicer transfoms (.h5 files) into Blender?

**URL:** <https://discourse.slicer.org/t/how-to-import-slicer-transfoms-h5-files-into-blender/44286>\
**Category:** Support\
**Created:** [August 31, 2025, 12:05am UTC](https://discourse.slicer.org/t/how-to-import-slicer-transfoms-h5-files-into-blender/44286 "2025-08-31T00:05:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![apparrilla](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/apparrilla/32/9230_2.png) [@apparrilla](https://discourse.slicer.org/u/apparrilla)\
**Post date:** [August 31, 2025, 12:05am UTC](https://discourse.slicer.org/t/how-to-import-slicer-transfoms-h5-files-into-blender/44286/1 "2025-08-31T00:05:32Z")

</div>

Hi everyone!

I want to extract rotation and position data from an Slicer transform (TR.h5) into Blender.

For now, I did:

1.- Install h5py library in Blender with add-on blender\_pip: Python module manager from [GitHub - amb/blender\_pip: A Blender addon for managing Python modules inside Blender with PIP](https://github.com/amb/blender_pip)

2.- Extract matrix values:

> with h5py.File(path, “r”) as f:  
> g = f[group]  
> params = np.array(g[‘TransformParameters’][:], dtype=float)  
> fixed = np.array(g[‘TransformFixedParameters’][:], dtype=float) if ‘TransformFixedParameters’ in g else np.zeros(3)

I don´t know how to build a valid matrix to make a Blender transform from these data.

Thanks in advance for any help!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 31, 2025, 7:34pm UTC](https://discourse.slicer.org/t/how-to-import-slicer-transfoms-h5-files-into-blender/44286/2 "2025-08-31T19:34:59Z")

</div>

You don’t have to install h5py (HDF5 can be a problematic library due to ABI incompatibilities). It is easier to save the transform as a text file (.tfm format) and then you can use [this code snippet in the script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#convert-between-itk-and-slicer-linear-transforms) to get the transformation matrix.

However, I would recommend not to waste time with saving and loading files. It is easier to start an OpenIGTLink server in Slicer (using OpenIGTLink extension) to expose any number of transforms, then in Blender use [pyigtl](https://pypi.org/project/pyigtl/) to get transforms from Slicer in real-time (or send transforms to Slicer). You can also send/receive meshes, images, etc.
