atlinter.data module

Gene dataset module.

class atlinter.data.GeneDataset(gene: np.ndarray, section_numbers: list[int], axis: str, volume_shape: tuple[int, int, int] | tuple[int, int, int, int] = (528, 320, 456, 3))[source]

Bases: object

Class representing gene dataset.

Parameters:
  • gene – Array containing all gene slices known from a given dataset. Dimensions should correspond to (n_genes, dim1, dim2) for grayscale images and (n_genes, dim1, dim2, 3) for RGB.

  • section_numbers – List of the section numbers of the gene slices.

  • axis – Axis of the gene dataset.

  • volume_shape – Shape of the final volume. Dimensions should correspond to (coronal, transverse, sagittal) for grayscale images and (coronal, transverse, sagittal, 3) for RGB.

get_closest_known(slice_number: int) int[source]

Obtain closest gene slice known for a given slice number.

get_surrounding_slices(slice_number: int) tuple[int | None, int | None][source]

Get the two known surrounding gene slices for a given slice number.

If index is smaller than all indices, the result will be (None, smallest indice) If index is bigger than all indices, the result will be (biggest indice, None) If index is equal to one of the indices, the result will be (index, next indice)

Parameters:

slice_number (int) – Index to look for surrounding gene slices

Returns:

  • left (int) – Left value to the index among indices.

  • right (int) – Right value to the index among indices.