get_window_index_pairs_for_image#

petpal.utils.scan_timing.get_window_index_pairs_for_image(image_path: str, window_duration: float)#

Computes start and end index pairs for windows of a given size based on the frame durations of a NIfTI image.

Parameters:
  • image_path (str) – Path to the NIfTI image file.

  • window_duration (float) – Window size in seconds.

Returns:

np.ndarray

Array of shape (2, N), where the first row contains start indices,

and the second row contains end indices for each window.

Raises:
  • ValueError – If window_duration is less than or equal to 0.

  • ValueError – If window_duration is greater than the total duration of all frames.