Skip to content

Coordinate warping of microscope movement #236

@simomounir

Description

@simomounir

So i have a use-case and I tried to used the warp_points.py example.

use case is: we image the sample in tiles and then the standard is to stitch the adjacent tiles. the tiles are numbered from 1 to N and each tile has an X,Y coordinate pair. I have a stitched Ref image and another image to be aligned to it.

I do the alignment and get /pickle as result. The tile coordinates (in millimeter) are associated to the Ref image.

This is how i proceed:

#########################################################

Load a registrar that has been saved

registrar_f = "registrar.pickle"
registrar = registration.load_registrar(registrar_f)
COORD_LEVEL = 0 # pyramid level from which the ROI coordinates originated. Usually 0.

Get slide from which the ROI coordinates originated

pt_source_img_f = "Ref.tiff"
pt_source_slide = registrar.get_slide(pt_source_img_f)

Convert coordinates to pixel units

um_per_px = pt_source_slide.reader.scale_physical_size(COORD_LEVEL)[0:2]
new_xy_px = bbox_xy_um/np.array(um_per_px)

Warp coordinates to position in registered slides

xy_in_registered_img = pt_source_slide.warp_xy(new_xy_px,
slide_level=COORD_LEVEL,
pt_level=COORD_LEVEL)

####################

I want to get the transformed coordinates that I input to the microscope and get tiles aligned with Ref.

-should i then put the Other/moving image as reference/fixed image? or should i inverse the transform and keep the Ref.tiff as fixed/reference?

  • is the transformation to stage physical coordinate done right?
    -i assume also only rigid should be done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions