Skip to main content
`Ctrl`+`K`

# cube_like_index_to_sequence_and_common_axis_indices

ndcube.utils.sequence.cube_like_index_to_sequence_and_common_axis_indices(

  cube_like_index,
  common_axis,
  common_axis_lengths,

)

  Converts a cube-like index for an NDCubeSequence to a sequence index and a common axis index.

  The sequence index is the index of the relevant NDCube in the sequence while the common axis index is the index within that cube along the common axis to which the input cube-like index corresponds.

  Parameters:

    - cube_like_index (`int`)

    - common_axis_lengths (iterable of `int`) – The lengths of each cube in the sequence along the common axis.

  Returns:

    - sequence_index (`int`) – Index of the cube in the sequence in which the cube-like index can be found.

    - common_axis_index (`int`) – The index along the cube’s common axis to which the input cube-like index corresponds.