weighted_series_sum_over_window_indices#

petpal.utils.useful_functions.weighted_series_sum_over_window_indices(input_image_4d: ants.core.ANTsImage | str, output_image_path: str | None, window_start_id: int, window_end_id: int, half_life: float, image_frame_info: petpal.utils.scan_timing.ScanTimingInfo) ants.core.ANTsImage | None#

Computes a weighted series sum over a specified window of indices for a 4D PET image.

Parameters:
  • input_image_4d (ants.core.ANTsImage | str) – Input 4D PET image as an ANTs image or the path to a NIfTI file.

  • output_image_path (str | None) – Path to save the output image. If None, the output is not saved.

  • window_start_id (int) – Start index of the image window.

  • window_end_id (int) – End index of the image window.

  • half_life (float) – Radioactive tracer’s half-life in seconds.

  • image_frame_info (scan_timing.ScanTimingInfo) – Frame timing information with: - duration (np.ndarray): Frame durations. - start (np.ndarray): Frame start times. - end (np.ndarray): Frame ends. - center (np.ndarray): Frame centers. - decay (np.ndarray): Decay correction factors.

Returns:

ants.core.ANTsImage – Resultant image after weighted sum computation.

Note

If output_image_path is provided, the computed image will be saved to the specified path. This allows us to utilize ANTs pipelines weighted_series_sum_over_window_indices(...).get_center_of_mass() for example.