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.
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 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 to get transforms from Slicer in real-time (or send transforms to Slicer). You can also send/receive meshes, images, etc.