glichtner / pystackreg

A python extension for the automatic alignment of a source image or a stack (movie) to a target image/reference frame.
Other
82 stars 17 forks source link

Apply Transformation matrix on XY coordinates #21

Closed Altairch95 closed 2 years ago

Altairch95 commented 2 years ago

Hi there,

I am working with fluorescence microscopy images of beads. The images are acquired on different channels (Red and Green). I would like to transform the red channel using the green as reference, but only on the XY coordinates.

Input: XY coords of beads on the red channel before transformation. Output: XY coords of beads on the red channel after transformation.

In other words, I would like to know if there is a way on PyStackReg to use the transformation matrix after Registration (e.g AFFINE) to transform XY coordinates instead of the whole image.

Thanks!

Altair

glichtner commented 2 years ago

Hey Altair,

sure, just use homogeneous coordinates (i.e., add a 3rd dimension with value 1 - if your coordinates are (x,y), use (x,y,1)) and (matrix-)multiply your points with the transformation matrix.

Best, Gregor