DecayCorrect#
- class petpal.preproc.decay_correction.DecayCorrect(image_loader: petpal.io.image.ImageLoader | None = None)#
Decay correct or uncorrect each frame in a dynamic PET scan.
- Variables:
image_loader – The image loader to use.
modified_pet_img – The corrected PET image.
- apply_factor(input_image_path: str, correction_factor: numpy.ndarray[float])#
Apply fix factor to image and write output.
- Parameters:
input_image_path (str) – Path to dynamic PET image.
correction_factor_path (str) – Path to file with correction factors, one per frame. File must have exactly one column, with a header followed by one scalar per line.
- save_modified_pet(input_image_path: str, output_image_path: str)#
Save the modified PET image
- Parameters:
input_image_path (str) – Path to dynamic PET image.
output_image_path (str) – Path to where corrected image is saved.
- decay_correct_factor_from_file(input_image_path: str, output_image_path: str, correction_factor_path: str)#
Apply a set of correction factors to each frame in a PET image.
Provide path to dynamic PET image, path to where corrected image is saved, and path to a file containing factors for each frame. File containing correction factors must have exactly one column, with a header followed by one scalar per line to apply to the corresponding frame in the PET. Reads image and correction factors, applies them, and saves result.
- Parameters:
input_image_path (str) – Path to dynamic PET image.
output_image_path (str) – Path to where corrected image is saved.
correction_factor_path (str) – Path to file with correction factors, one per frame. File must have exactly one column, with a header followed by one scalar per line.