Skip to content

Index Manager

Source

GridIndexManager dataclass

dataset_idx_from_grid_idx(grid_idx)

Returns the index of the grid in the dataset.

get_grid_index(dim, coordinate)

Returns the index of the grid in the specified dimension.

get_gridstart_location_from_dim_index(dim, dim_index)

Returns the grid-start coordinate of the grid in the specified dimension.

get_individual_dim_grid_count(dim)

Returns the number of the grid in the specified dimension, ignoring all other dimensions.

get_location_from_dataset_idx(dataset_idx)

Returns the start location of the grid in the dataset.

get_patch_location_from_dataset_idx(dataset_idx)

Returns the patch location of the grid in the dataset.

grid_count(dim)

Returns the total number of grids for one value in the specified dimension.

next_grid_along_dim(dataset_idx, dim)

Returns the index of the grid in the specified dimension in the specified direction.

on_boundary(dataset_idx, dim, only_end=False)

Returns True if the grid is on the boundary in the specified dimension.

prev_grid_along_dim(dataset_idx, dim)

Returns the index of the grid in the specified dimension in the specified direction.

total_grid_count()

Returns the total number of grids in the dataset.

GridIndexManagerRef dataclass

get_grid_index(shape, dim, coordinate)

Returns the index of the patch in the specified dimension.

get_gridstart_location_from_dim_index(shape, dim_idx, dim)

Returns the grid-start coordinate of the grid in the specified dimension.

dim_idx: int Index of the dimension in the data shape. dim: int Value of the dimension in the grid (relative to num patches in dimension).

get_individual_dim_grid_count(shape, dim)

Returns the number of the grid in the specified dimension, ignoring all other dimensions.

get_location_from_patch_idx(channel_idx, patch_idx)

Returns the start location of the grid in the dataset. Per channel!.

Parameters:

Name Type Description Default
patch_idx int

The index of the patch in a list of samples within a channel. Channels can be different in length.

required

get_location_from_patch_idx_o(dataset_idx)

Returns the start location of the grid in the dataset.

get_patch_location_from_patch_idx(ch_idx, patch_idx)

Returns the patch location of the grid in the dataset.

grid_count_per_sample(shape)

Returns the total number of patches for one dimension.

next_grid_along_dim(dataset_idx, dim)

Returns the index of the grid in the specified dimension in the specified direction.

on_boundary(dataset_idx, dim, only_end=False)

Returns True if the grid is on the boundary in the specified dimension.

patch_idx_from_grid_idx(shape, grid_idx)

Returns the index of the patch in the dataset.

prev_grid_along_dim(dataset_idx, dim)

Returns the index of the grid in the specified dimension in the specified direction.

total_grid_count()

Returns the total number of patches in the dataset.