Image Registration

Module Documentation

This module provides a wrapper for WSI registration using VALIS. It includes registration of WSIs either with or without a reference slide around VALIS’s interal registration functions, as well as a more recent customizable high-resolution registration method.

Primary Functions

cubats.slide_collection.registration.register_slides(slide_src_dir, results_dst_dir, registered_slides_dst=None, microregistration=False, max_non_rigid_registration_dim_px=2000, crop=None)[source]

Register the slides using Valis. This function automatically registers the slides and saves the registered slides in the specified directory.

Parameters:
  • slide_src_dir (str) – Path to input slides.

  • results_dst_dir (str) – Path to directory where results will be saved.

  • registered_slides_dst (str, optional) – Path to directory where registered slides will be saved. If no path is provided, the registered slides will be saved in the results directory under “registered_slides”.

  • microregistration (bool, optional) – Whether to perform microregistration after rigid and non-rigid registration. Defaults to False.

  • max_non_rigid_registration_dim_px (int, optional) – Maximum size of the non-rigid registration dimension in pixels. Defaults to 2000.

  • crop (str, optional) – Crop type for the registered slides. Can be “overlap” or “reference”. Defaults to “overlap”.

cubats.slide_collection.registration.register_slides_with_reference(slide_src_dir, results_dst_dir, referenceSlide, registered_slides_dst=None, microregistration=False, max_non_rigid_registration_dim_px=2000, crop=None)[source]

Register the slides with a reference slide using Valis. This function automatically registers the slides and saves the registered slides in the specified directory.

Parameters:
  • slide_src_dir (str) – Path to input slides

  • results_dst_dir (str) – Path to directory where results will be saved

  • referenceSlide (str) – Path to reference slide

  • registered_slides_dst (str, optional) – Path to directory where registered slides will be saved. If no path is provided, the registered slides will be saved in the results directory under “registered_slides”.

  • microregistration (bool, optional) – Whether to perform microregistration after rigid and non-rigid registration. Defaults to False.

  • max_non_rigid_registration_dim_px (int, optional) – Maximum size of the non-rigid registration dimension in pixels. Defaults to 2000.

  • crop (str, optional) – Crop type for the registered slides. Can be “overlap” or “reference”. Defaults to “reference”.

cubats.slide_collection.registration.register_slides_high_resolution(slide_src_dir, results_dst_dir, registered_slides_dst=None, micro_reg_fraction=None)[source]

Performs high resolution alignment.