Iterative Write#

get_image_series_chunk_shape(*, num_samples: int, sample_shape: tuple[int, int, int] | tuple[int, int, int, int], dtype: dtype, chunk_mb: float = 10.0) tuple[int, int][source]#

Estimate good chunk shape for a ImageSeries dataset.

This function gives good estimates for cloud access patterns.

Parameters:
  • num_samples (int) – The number of frames in the ImageSeries dataset.

  • sample_shape (tuple[int, int, int] | tuple[int, int, int, int]) – The shape of a single sample for the ImageSeries. For TwoPhotonSeries, this might be (num_columns, num_rows) or (num_columns, num_rows, num_planes). For ImageSeries, this might be (num_columns, num_rows, num_channels).

  • dtype (np.dtype) – The data type of the ImageSeries dataset.

  • chunk_mb (float, optional) – The upper bound on size in megabytes (MB) of the internal chunk for the HDF5 dataset. The default is 10MB, as recommended by the HDF5 group.

Returns:

The chunk shape for the TwoPhotonSeries dataset.

Return type:

tuple[int, int, int] | tuple[int, int, int, int]

get_image_series_buffer_shape(*, chunk_shape: tuple[int, int, int] | tuple[int, int, int, int], sample_shape: tuple[int, int, int] | tuple[int, int, int, int], series_shape: tuple[int, int, int] | tuple[int, int, int, int], dtype: dtype, buffer_gb: float = 1.0) tuple[int, int, int] | tuple[int, int, int, int][source]#

Estimate good buffer shape for a ImageSeries dataset.

This function gives good estimates for cloud access patterns.

Parameters:
  • chunk_shape (tuple[int, int, int] | tuple[int, int, int, int]) – The shape of the chunk for the ImageSeries dataset.

  • sample_shape (tuple[int, int, int] | tuple[int, int, int, int]) – The shape of a single sample for the ImageSeries. For TwoPhotonSeries, this might be (num_columns, num_rows) or (num_columns, num_rows, num_planes). For ImageSeries, this might be (num_columns, num_rows, num_channels).

  • series_shape (tuple[int, int, int] | tuple[int, int, int, int]) – The shape of the full ImageSeries dataset.

  • dtype (np.dtype) – The data type of the ImageSeries dataset.

  • buffer_gb (float) – The upper bound on size in gigabytes (GB) of the internal chunk for the HDF5 dataset.

Returns:

The buffer shape for the TwoPhotonSeries dataset.

Return type:

tuple[int, int] | tuple[int, int, int]

get_electrical_series_chunk_shape(*, number_of_channels: int, number_of_frames: int, dtype: dtype, chunk_mb: float = 10.0) tuple[int, int][source]#

Estimate good chunk shape for an ElectricalSeries dataset.

This function gives good estimates for cloud access patterns.

Parameters:
  • number_of_channels (int) – The number of channels in the ElectricalSeries dataset.

  • number_of_frames (int) – The number of frames in the ElectricalSeries dataset.

  • dtype (np.dtype) – The data type of the ElectricalSeries dataset.

  • chunk_mb (float, optional) – The upper bound on size in megabytes (MB) of the internal chunk for the HDF5 dataset. The chunk_shape will be set implicitly by this argument.

Returns:

The chunk shape for the ElectricalSeries dataset.

Return type:

tuple[int, int]