RegisterPet#
- class petpal.preproc.register.RegisterPet(image_loader: petpal.io.image.ImageLoader | None = None)#
Bases:
RegisterBaseAPI for registration of dynamic PET image to a static template.
- Variables:
image_loader –
ImageLoader()instance or injectable replacementtable_saver –
TableSaver()instance or injectable replacementinput_img – (ants.ANTsImage) Dynamic PET image
target_img – (ants.ANTsImage) Static target image
scan_timing –
ScanTimingInfo()Dynamic PET scan timing.half_life – (float) Half life of the PET tracer in seconds.
- Ivar:
reg_kwargs: (dict) Keyword arguments passed on to
registration()
- set_reference_img(reference_image_path: str)#
- register_target(transform_type: str = 'DenseRigid')#
Calculate tranform from static target image to reference.
- apply_transform(xfm_path: str)#
Apply the calculated transform to the dynamic PET image.
- __call__(input_image_path: str, out_image_path: str, motion_target_path: str, reference_image_path: str, transform_type: str = 'DenseRigid', out_xfm_folder: str = None, **reg_kwargs)#
Register dynamic PET to reference
- Parameters:
input_image_path (str) – Path to dynamic PET image
out_image_path (str) – Path to dynamic PET registered to the reference
motion_target_path (str) – Path to motion target image, the static image used for calculating transform to reference space.
reference_image_path (str) – Path to static reference image, such as bias-corrected T1.
transform_type (str) – Type of transform to use when calculating transform. Passed on to
ants.registration()as type_of_transform. Suggested options are ‘DenseRigid’ for rotation and scaling and ‘Affine’ for 12 parameter transform. Default ‘DenseRigid’.out_xfm_folder (str) – If set, saves transform files for each stage to the specified folder.
reg_kwargs (kwargs) – Additional keyword arguments passed on to
ants.registration().
- property default_reg_kwargs: dict#
Default registration arguments passed on to
registration().
- set_reg_kwargs(**reg_kwargs)#
Modify the registration arguments passed on to
registration().
- set_input_scan_properties(input_image_path: str)#
Load input image and get half life and scan timing. Set as MotionCorrect attributes.
- Parameters:
input_image_path (str) – Path to dynamic PET image.
- set_target_img(motion_target_path: str)#
Get the motion target, load it as an image, and set as an attribute.
- Parameters:
input_image_path (str) – Path to dynamic PET image.
motion_target_option (str | tuple) – Option for motion target. See
()for details.