informatics-isi-edu / openseadragon-viewer

2D viewer with openseadragon
Apache License 2.0
5 stars 2 forks source link

Display images one at a time #106

Open RFSH opened 1 year ago

RFSH commented 1 year ago

Currently, we're always assuming the individual images (URLs) are channels of the same image. So we're always blending them and showing them as channels. But we sometimes want to show these images one at a time.

The following are different ways that we can achieve this:

  1. We could use the same concept of channels and make sure we're showing the "channels" one at a time. So when users toggle a channel, all the other ones will be hidden. This would be simple to implement, and we just need to add a flag to turn this feature on. However, this means that we cannot have actual channels anymore (Each displayed image will be single channel and we won't try to blend images). Abusing the same channel concept might also be misleading and confusing.

  2. OpenSeadragon has a "sequence mode" which can be turned on. You can see how it works here. With this, instead of using addTiledImage API, we would have to set the images during load (OpenSeadragon({ tileSources: ... })). So as far as I could tell, we cannot mix the concept of channels with "sequence mode".

  3. As suggested here, we could handle switching between images ourselves. This gives us more flexibility. Since we're responsible for switching the images, we could have channels in this mode (Each displayed image could be a multi-channel image). This method is very similar to how we're supporting multi-Z images. We're basically clearing the canvas and repainting it with the channels from another Z.