informatics-isi-edu / openseadragon-viewer

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

Channel handling #48

Closed rastogi-bhavya closed 3 years ago

rastogi-bhavya commented 4 years ago
  1. when do we see the channel controller (the one that allow you to change?
  2. What does the code do when the hue is changed?
  3. Is the change of color done by OSD?

What we will likely do is to have a default hue by mapping from channel-name (or number if name is not available) to a present hue (color), and use that for rendering.

Add https://dev.rebuildingakidney.org/chaise/record/#2/Gene_Expression:Image/RID=14-47YP to regression testing

rastogi-bhavya commented 4 years ago

The change is color is handled by a OSD library called OpenSeadragonFiltering (https://github.com/usnistgov/OpenSeadragonFiltering). The new channels values (filter in terms of the library) are passed to the setItemChannel, which updates the values stored in the channels object and calls the setFilterOptions of the library to update the channels values shown in the OSD.

rastogi-bhavya commented 4 years ago

The reason the Hue is not visible for some channels is because the name of the channel is not proper i.e. they have '_' in the name instead of space eg 'Alexa_Fluor_488' instead of 'Alexa Fluor 488'

https://dev.rebuildingakidney.org/chaise/viewer/#2/Gene_Expression:Image/id=14-47YP?waterMark=gudmap.org&meterScaleInPixels=3082824

Screen Shot 2020-09-09 at 1.53.03 PM.png

rastogi-bhavya commented 4 years ago

https://github.com/informatics-isi-edu/openseadragon-viewer/blob/ea225e12fe1fa244400aedb526038d735ed2f4d4/js/viewer/channel/channel.js#L78

This describe the process used to convert RGB -> HSL, and the function _rgb2hsl returns [h, s, l] https://stackoverflow.com/questions/23090019/fastest-formula-to-get-hue-from-rgb

RFSH commented 3 years ago

More info has been added to the following guides:

https://github.com/informatics-isi-edu/openseadragon-viewer/wiki/Openseadragon-Dev-Guide#how-channels-work

https://github.com/informatics-isi-edu/openseadragon-viewer/wiki/OSD-viewer-guide#channel-filter-and-color