HDF5 data format learning

HDF5 data format learning

The author recently learned the ICCV2019 "Recursive Cascaded Networks for Unsupervised Medical Image Registration" code. Its preprocessed data is in hdf5 format. Here is a brief understanding and learning. Reference materials Introduction to HDF5 may require scientific Internet access.

HDF5 data format introduction

Insert picture description here
As shown in the figure above, the structure of an HDF5 file mainly includes a group and a dataset. Each file contains a root group by default, and a group or dataset can be created under this group. Corresponding to our commonly used Windows Explorer, group can correspond to folders, and dataset can correspond to files. HDF5 dataset can be images, tables, etc. The code of "Recursive Cascaded Networks for Unsupervised Medical Image Registration" uses only matrix format data, such as three-dimensional volume data, three-dimensional segmentation annotation, and two-dimensional key point coordinates.

HDF5 data visualization

Refer to the python HDF5 file to easily visualize the data used in "Recursive Cascaded Networks for Unsupervised Medical Image Registration", as shown in the figure below:
Insert picture description here
Slliver data includes volume, point, segmentation. At present, the id is not available. The author does not understand the reason, nor is it clear what the id represents when the code author generates these pre-processed data, but I don’t think it has a big impact. Other data sets can be visualized.
Note : The value of segmentation in the verification set of brain lpba_val.h5 is related to which category the pixel is classified into. The specific correspondence can be seen in the segmentation_class_value of brain.json, which has a total of 56 regions; the data set of liver has only one segmentation of liver, although The value is also different, but according to the operation in the code, >128 is considered to be the liver area.

Create HDF5 data (Basic Python Code)

Create HDF5 file

Insert picture description here

Create dataset

Insert picture description here
Insert picture description here

Insert picture description here

Create group

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_35898332/article/details/112473031