stitch_broken_scans#
- petpal.preproc.image_operations_4d.stitch_broken_scans(input_image_path: str, output_image_path: str, noninitial_image_paths: list[str]) ants.ANTsImage#
‘Stitch’ together 2 or more images from one session into a single image.
This function takes multiple images (4D) from a single PET session in which the scan had to pause in the middle (a ‘broken scan’), recomputes decay corrections for all noninitial images using the correct TimeZero (TimeZero for the first image), then combines all the data into a single file to write (unless output_image_path is None, in which case the function will pass the ANTsImage object.
Important: All noninitial images must be registered to the first image prior to calling this function.
- Parameters:
input_image_path (str) – Path to the initial image captured during PET session. ‘TimeZero’ from this image will be considered as the true value to correct the rest of the images to.
output_image_path (str) – Path to which the stitched image will be written. If None, no file will be written.
noninitial_image_paths (list[str]) – Path(s) to 1 or more additional images containing data from broken sections of the PET session. Note that all images must be registered to the first (input_image_path).
- Returns:
ants.ANTsImage – stitched image