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
284 stars 46 forks source link

slide rotation #703

Open aliaksandr-voranau opened 1 year ago

aliaksandr-voranau commented 1 year ago

Hello!

Is it possible to adjust the slide rotation? The viewState currently includes parameters like { target: [x, y, z], zoom: zoom }. I've inspected the entire documentation, but I couldn't find any information regarding adjusting slide rotation.

ilan-gold commented 1 year ago

If by "slide" you mean the image, then you will need to pass in a modelMatrix that encodes your rotation - this can be done for the components and layers.

aliaksandr-voranau commented 11 months ago

@ilan-gold thanks for your answer, I have couple more:

  1. If I'm not mistaken (also according to the documentation), modelMatrix is only available on the VolumeViewer, but how I can rotate images on the other components such as SideBySideViewer, PictureInPictureViewer ?
  2. Maybe you have an example with modelMatrix? I mean, the example of the object which I should pass to this prop. Documentation tells, that it should be an object, by doesn't describe the shape of such object.
ilan-gold commented 11 months ago

Ok @aliaksandr-voranau you are right about the viewers. I am not sure what is to be done here, though. Those viewers encode very special behavior. I would venture a guess that adding the functionality in the PictureInPictureViewer is non-trivial but I am not sure. SideBySideViewer would probably be simpler. It should not be hard to discard the PIP functionality and lightly wrap VivViewer to use a ModelMatrix. We unfortunately do not have an example besides vitessce which only uses the layers.