Micro-rigid registration
Classes
MicroRigidRegistrar
- class valis.micro_rigid_registrar.MicroRigidRegistrar(val_obj, feature_detector_cls=<class 'valis.feature_detectors.SuperPointFD'>, matcher=<class 'valis.feature_matcher.SuperPointAndGlue'>, processor_dict=None, scale=0.125, tile_wh=512, roi='mask')[source]
Refine rigid registration using higher resolution images
Rigid transforms found during lower resolution images are applied to the WSI and then downsampled. The higher resolution registered images are then divided into tiles, which are processed and normalized. Next, features are detected and matched for each tile, the results of which are combined into a common keypoint list. These higher resolution keypoints are then used to estimate a new rigid transform. Replaces thumbnails in the rigid registration folder.
- feature_detector_cls
Uninstantiated FeatureDD object that detects and computes image features. Default is SuperPointFD. The available feature_detectors are found in the feature_detectors module. If a desired feature detector is not available, one can be created by subclassing feature_detectors.FeatureDD.
- Type:
FeatureDD, optional
- scale
Degree of downsampling to use for the reigistration, based on the registered WSI shape (i.e. Slide.aligned_slide_shape_rc)
- Type:
- roi
Determines how the region of interest is defined. roi=”mask” will use the bounding box of non-rigid registration mask to define the search area. roi=matches will use the bounding box of the previously matched features to define the search area.
- Type:
string
- iter_order
Determines the order in which images are aligned. Goes from reference image to the edges of the stack.
- Type:
list of tuples
- __init__(val_obj, feature_detector_cls=<class 'valis.feature_detectors.SuperPointFD'>, matcher=<class 'valis.feature_matcher.SuperPointAndGlue'>, processor_dict=None, scale=0.125, tile_wh=512, roi='mask')[source]
- Parameters:
val_obj (Valis) – The “parent” object that registers all of the slides.
feature_detector_cls (FeatureDD, optional) – Uninstantiated FeatureDD object that detects and computes image features. Default is SuperPointFD. The available feature_detectors are found in the feature_detectors module. If a desired feature detector is not available, one can be created by subclassing feature_detectors.FeatureDD.
matcher (Matcher) – Matcher object that will be used to match image features
processor_dict (dict, optional) – Each key should be the filename of the image, and the value either a subclassed preprocessing.ImageProcessor, or a list, where the 1st element is the processor, and the second element a dictionary of keyword arguments passed to the processor. If None, a default processor will be assigned to each image based on its modality.
scale (float) – Degree of downsampling to use for the reigistration, based on the registered WSI shape (i.e. Slide.aligned_slide_shape_rc)
tile_wh (int) – Width and height of tiles extracted from registered WSI
roi (string) – Determines how the region of interest is defined. roi=”mask” will use the bounding box of non-rigid registration mask to define the search area. roi=matches will use the bo
- register(brightfield_processing_cls=<class 'valis.preprocessing.StainFlattener'>, brightfield_processing_kwargs={'adaptive_eq': False, 'with_mask': False}, if_processing_cls=<class 'valis.preprocessing.ChannelGetter'>, if_processing_kwargs={'adaptive_eq': True, 'channel': 'dapi'})[source]
- Parameters:
brightfield_processing_cls (ImageProcesser) – ImageProcesser to pre-process brightfield images to make them look as similar as possible. Should return a single channel uint8 image.
brightfield_processing_kwargs (dict) – Dictionary of keyward arguments to be passed to brightfield_processing_cls
if_processing_cls (ImageProcesser) – ImageProcesser to pre-process immunofluorescent images to make them look as similar as possible. Should return a single channel uint8 image.
if_processing_kwargs (dict) – Dictionary of keyward arguments to be passed to if_processing_cls