httomo.runner.dataset.DataSetBlock#

class httomo.runner.dataset.DataSetBlock(data: ndarray, aux_data: AuxiliaryData, slicing_dim: Literal[0, 1, 2] = 0, block_start: int = 0, chunk_start: int = 0, global_shape: Tuple[int, int, int] | None = None, chunk_shape: Tuple[int, int, int] | None = None, padding: Tuple[int, int] = (0, 0))[source]#

Data storage type for block processing in high throughput runs

Methods

__init__(data, aux_data[, slicing_dim, ...])

Constructs a data block for processing in the pipeline in high throughput runs.

Attributes

chunk_index

The index of this block within the chunk handled by the current process

chunk_index_unpadded

The index of the core area of this block within the chunk (padding removed)

chunk_shape

Shape of the full chunk handled by the current process

chunk_shape_unpadded

Shape of the full chunk core area handled by the current process (with padding removed)

data

data_unpadded

Return the data, but with the padding slices removed

global_index

The index of this block within the global data across all processes

global_index_unpadded

The index of the core area of this block within the global data across all processes (with padding removed)

global_shape

Shape of the global data across all processes

is_last_in_chunk

Check if the current dataset is the final one for the chunk handled by the current process

is_padded

Determine if this is a padded block

padding

Get the 'before' and 'after' padding values for this block.

shape_unpadded

Shape of the core date in this block, with padding removed

slicing_dim

Return the slicing dimenions of the block

property chunk_index: Tuple[int, int, int]#

The index of this block within the chunk handled by the current process

property chunk_index_unpadded: Tuple[int, int, int]#

The index of the core area of this block within the chunk (padding removed)

property chunk_shape: Tuple[int, int, int]#

Shape of the full chunk handled by the current process

property chunk_shape_unpadded: Tuple[int, int, int]#

Shape of the full chunk core area handled by the current process (with padding removed)

property data: ndarray | cupy.ndarray#
property data_unpadded: ndarray | cupy.ndarray#

Return the data, but with the padding slices removed

property global_index: Tuple[int, int, int]#

The index of this block within the global data across all processes

property global_index_unpadded: Tuple[int, int, int]#

The index of the core area of this block within the global data across all processes (with padding removed)

property global_shape: Tuple[int, int, int]#

Shape of the global data across all processes

property is_last_in_chunk: bool#

Check if the current dataset is the final one for the chunk handled by the current process

property is_padded: bool#

Determine if this is a padded block

property padding: Tuple[int, int]#

Get the ‘before’ and ‘after’ padding values for this block. This is to be understood as the the number of padding slices in the ‘slicing_dim’ direction that come before and after the core area of the block. If no padding is used, it returns (0, 0).

property shape_unpadded: Tuple[int, int, int]#

Shape of the core date in this block, with padding removed

property slicing_dim: Literal[0, 1, 2]#

Return the slicing dimenions of the block