Skip to content
artzers edited this page Jul 27, 2020 · 26 revisions

WHY HDF5?

In order to observe the local area of a large image whose thickness is more than 512 pixels, GTree can create HDF5 format data for large tiff format data. User can change the image level value to view images of different resolutions. Image level number N, refers to 2^(N-1) downsampled images. Image level 1 refers to the original images. If the image-level is bigger than the maximum level, GTree will inform user to turn down the image level. The operations under HDF5 mode are the same as those under TDat/Mostd mode. However, traversal check and differences matching modules have not been implemented under HDF5 mode now.

HDF5 is not efficient for large scale data more than a hundred GB. Please applying TDat.

Note: If any axial length of the target image is smaller than 512, GTree will refuse to build HDF5 dataset.

Step 1

Please use fiji/imagej to slice the tiff format data along z-direction and save as tiff image sequence in an empty directory. Or you can use the following codes(python) shown below to carry on the work.

import tifffile as tf
import numpy as np
import os

filePath = 'D:/TIF/'
savePath = 'D:/HDF5/'
fileName = 'test.tif'

image = tf.imread(os.path.join(filePath, fileName))
Slice = image.shape
m = Slice[0]
for i in range(0, m):
    imageS = image[i,:,:]
    im_name = 'test_%03d.tif' % (i)
    tf.imsave(os.path.join(savePath, im_name), imageS)

Step 2

Open GTree software and use creat HDF5 function:click “Creat HDF5” button in the red square.

fig 1

Fig.1

Step 3

Click the “Select Tiff” button and import the whole obtained pictures in step 1. Set the resolutions of the target HDF5 file. The resolutions cannot be modified in the generated HDF5 file.

fig 2

Fig.2

fig 3

Fig.3

Step 4

Import HDF5 format data(“.h5” format): the same as Single Image step 1.

Step 5

Input image range or enter interactive mode to set the image reading range. Click the "Apply Read" button to import the target image data.

fig 4

Fig.4