# Visualize arrays stored in h5

**URL:** <https://discourse.slicer.org/t/visualize-arrays-stored-in-h5/7953>\
**Category:** Feature requests\
**Created:** [August 8, 2019, 9:43pm UTC](https://discourse.slicer.org/t/visualize-arrays-stored-in-h5/7953 "2019-08-08T21:43:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogertrullo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rogertrullo/32/4380_2.png) [@rogertrullo](https://discourse.slicer.org/u/rogertrullo)\
**Post date:** [August 8, 2019, 9:43pm UTC](https://discourse.slicer.org/t/visualize-arrays-stored-in-h5/7953/1 "2019-08-08T21:43:16Z")

</div>

Hi,  
I know that hdf5 is just a container as discussed in [here](https://discourse.slicer.org/t/regarding-h5-file-format/4172/2) , however I think it can be a greate feature to have some kind of option to display 3d arrays in 3D slicer. The format is widely used in the machine learning community and I find my self duplicating data to common formats just to visualize it. As an example, there is also the xdmf format which can read the data array from h5 files and which can be visualized in paraview. Would it be difficult to add support for this?  
Otherwise, is it possible to make a python pluggin for this purpose; if so what would be an example to start with?  
Thanks!

Roger

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [August 9, 2019, 12:25am UTC](https://discourse.slicer.org/t/visualize-arrays-stored-in-h5/7953/2 "2019-08-09T00:25:05Z")

</div>

Hi Roger -

Sure, that sounds pretty useful and doable in a few lines of python. I believe you can easily get a numpy array with contents of the h5 file and you can populate a `vtkMRMLScalarVolumeNode` with the data.

[https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python\_scripting#Accessing\_Volume\_data\_as\_numpy\_array](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting#Accessing_Volume_data_as_numpy_array)
