# What is the structure of HDF5 / h5 file

**URL:** https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200
**Category:** Beginner Questions
**Tags:** itk, python, io
**Created:** [September 13, 2023, 11:26am UTC](https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200 "2023-09-13T11:26:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![m.ded](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@m.ded](https://discourse.itk.org/u/m.ded)
#### Post date: [September 13, 2023, 11:26am UTC](https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200/1 "2023-09-13T11:26:10Z")

</div>

I use ANTs [GitHub - ANTsX/ANTs: Advanced Normalization Tools (ANTs)](https://github.com/ANTsX/ANTs) to to create deformation fields in HDF5 format.  
ANTs h5 transform files come from the ITK underlying IO system.

I would like to understand the structure of these h5 files to enable conversion from Elastix .nii file to .h5 file.  
However, I do not understand all the values that are in the file. It contains a group “TransformGroup” which in turn contains groups “0”, “1” and “2”.

For example, “1” and “2” contains a dataset “TransformFixedParameters”. But I don’t understand what the values represent.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [September 13, 2023, 12:38pm UTC](https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200/2 "2023-09-13T12:38:13Z")

</div>

Does taking a look at this section and the rest of this file help?

> <https://github.com/InsightSoftwareConsortium/ITK/blob/v5.3.0/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx#L470-L501>

---

<div class="post-metadata">

### Author: ![m.ded](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@m.ded](https://discourse.itk.org/u/m.ded)
#### Post date: [September 13, 2023, 3:31pm UTC](https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200/3 "2023-09-13T15:31:32Z")

</div>

Thank you, but not really. I am not that familial with C++. I read the code and the method WriteFixedParameters but I can’t figure out what information transformFixedNameMisspelled, transformParamsNameMisspelled and transformFixedName store. in the ANTs-HDF5-file.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [September 13, 2023, 4:05pm UTC](https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200/4 "2023-09-13T16:05:23Z")

</div>

This comment explains the 0,1,2 group names?

> <https://github.com/InsightSoftwareConsortium/ITK/blob/v5.3.0/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx#L490-L492>

For conversion, maybe read in the `.nii` image, set it to a [DisplacementFieldTransform](https://itk.org/Doxygen/html/classitk_1_1DisplacementFieldTransform.html), and then write it using [TransformFileWriter](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/IO/TransformReadWrite.cxx)?

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [September 22, 2023, 8:43pm UTC](https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200/5 "2023-09-22T20:43:48Z")

</div>

Hi,

The TransformFixedParameters are the transformation parameters that are not optimized during registration. Other parameters are optimized during registration. Transform parameters are described in the [ITK Software Guide](https://itk.org/ItkSoftwareGuide.pdf).
