get_frame_from_timeseries#

petpal.utils.dimension.get_frame_from_timeseries(input_img: ants.ANTsImage, frame: int) ants.ANTsImage#

Get a single frame of a 4D image as a 3D image.

A simplified version of ants.ndimage_to_list.ndimage_to_list().

Parameters:
  • input_img (ants.ANTsImage) – The 4D image from which to get the frame.

  • frame (int) – The index of the frame to extract from the time series image.

Returns:

img_3d (ants.ANTsImage) – The 3D first frame of the input image as an ants image.