Skip to content

don't save thousands of images in a directory #13

@RebeccaWPerry

Description

@RebeccaWPerry

SEAS IT gave us the feedback that we should not be using our current method of organizing data series by using directories full of thousands of .tif images. Instead, we can use HDF5 which is an extremely general data storage framework.

I propose:

  • Still save individual images that you capture one at a time as .tif's
  • For slow and fast time series, save all images into a single HDF5 file
  • For slow and fast time series, also save the first image of the time series as a .tif alongside the HDF5 as a thumbnail to show what is inside the HDF5.

Multipage tif's max out at 4GB unless you use bigtiff. I'm not sure how to write out a multipage tiff without having all the images in memory. All our images are in the frame grabber's memory, and then we like to transfer the images one at a time through the operating system's memory and to the hard disk.

Writing out 100 images to an HDF5 file could look like this:

import h5py

f = h5py.File("mytestfile.hdf5","w")

for i in range(100):
fakeim = around(10*rand(1024,1024))
dset = f.create_dataset(str(i),data=fakeim)

f.close()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions