osl_dynamics.analysis.post_hoc.state_activations#
- osl_dynamics.analysis.post_hoc.state_activations(state_time_course)#
Calculate state activations from a state time course.
Given a state time course (strictly binary), calculate the beginning and end of each activation of each state. Accepts a 1D or 2D array. If a 1D array is passed, it is assumed to be a single state time course.
Either an array of ints or an array of
boolis accepted, but ifintare passed they should be explicitly 0 or 1.- Parameters:
- state_time_coursenumpy.ndarray or list of numpy.ndarray
State time course (strictly binary).
- Returns:
- sliceslist of list of slice
List containing state activations (index) in the order they occur for each state. This cannot necessarily be converted into an array as an equal number of elements in each array is not guaranteed.