brain_mask_pet ============================================ .. py:function:: petpal.preproc.brain_mask_pet.brain_mask_pet(input_image_path: str, out_image_path: str | None, atlas_image_path: str, atlas_mask_path: str, motion_target_option='weighted_series_sum') -> ants.ANTsImage Apply brain mask to dynamic PET image. Create target PET image, which is then warped to a provided anatomical atlas. The transformation to atlas space is then applied to transform a provided mask in atlas space into PET space. Mask is applied to input dynamic PET, optionally saved to out_image_path, and returned. :param input_image_path: Path to input 4D PET image. :type input_image_path: str :param out_image_path: Path to which brain mask in PET space is written. :type out_image_path: str :param atlas_image_path: Path to anatomical atlas image. :type atlas_image_path: str :param atlas_mask_path: Path to brain mask in atlas space. :type atlas_mask_path: str :param motion_target_option: Used to determine 3D target in PET space. Default 'weighted_series_sum'. :returns: *pet_masked_image (ants.ANTsImage)* -- Dynamic PET image masked to brain only. .. note:: Requires access to an anatomical atlas or scan with a corresponding brain mask on said anatomical data. FSL users can use the MNI152 atlas and mask available at $FSLDIR/data/standard/.