resample_blood_data_on_scanner_times#

petpal.input_function.blood_input.resample_blood_data_on_scanner_times(blood_tac_path: str, out_tac_path: str, reference_4dpet_img_path: str, lin_fit_thresh_in_mins: float, rescale_constant: float = 37000.0)#

Resample blood time-activity curve (TAC) based on PET scanner frame times. The function assumes that the PET meta-data have ‘FrameReferenceTime’ in seconds. The saved TAC is in minutes.

This function takes the raw blood TAC sampled at arbitrary times, resamples it to the frame times of a 4D PET image, and saves the resampled TAC to a file.

Parameters:
  • reference_4dpet_img_path (str) – Path to the 4D PET image file.

  • blood_tac_path (str) – Path to the file containing raw blood time-activity data.

  • lin_fit_thresh_in_mins (float) – Threshold in minutes for piecewise linear fit.

  • out_tac_path (str) – Path to save the resampled blood TAC.

  • rescale_constant (float) – Constant to rescale the blood TAC data.

Returns:

None. In the saved TAC file, the first column will be time in minutes,

and the second column will be the activity.

Example

resample_blood_data_on_scanner_times(
    pet4d_path='pet_image.nii.gz',
    raw_blood_tac='blood_path.csv',
    lin_fit_thresh_in_mins=0.5,
    out_tac_path='resampled_blood_tac.csv'
)