hms-dbmi / viv

Library for multiscale visualization of high-resolution multiplexed bioimaging data on the web. Directly renders Zarr and OME-TIFF.
http://avivator.gehlenborglab.org
MIT License
279 stars 42 forks source link

Allow affine transformations for MultiscaleImageLayer #156

Closed manzt closed 3 years ago

manzt commented 4 years ago

Right now we only allow scale & translate in the StaticImageLayer. There is no way to apply an affine transformation a tiled layer (relative to another tiled layer or static layer). This will be necessary if we have have multiple tiled images.

ilan-gold commented 4 years ago

Can you explain further why we would need this?

manzt commented 4 years ago

We just assume that the highest resolution image (which is tiled) starts at coordinate position [0, 0] and scale / translate other smaller images relative to this. But imagine that the IMS data were high enough resolution that we would need to tile it as well, there would be no way to register the two layers together. If we every had images that we wanted to overlay that were both tiled but different heights and widths and pixel sizes, we can't register them.

Tangible example:

Image 1: shape: (4 x 50000 x 50000); tile size: 512 Image 2: shape: (4 x 10000 x 10000); tile size: 512

Pixel size of image 2 is twice that of image 1, and we are given it's top-left corner is (4000, 2560) in the highest resolution space (image 1 scale == 1). How do we display these two layers?

manzt commented 4 years ago

We are fortunate that the images we want to super impose are not tiled, but I don't this this is a fair assumption to make for all images and limits our utility as a multimodal viewer.

manzt commented 3 years ago

I'm closing in favor of #217