These are chat archives for openseadragon/openseadragon

4th
Aug 2015
DanGart
@DanGart
Aug 04 2015 14:52
Hey guys, i'm new to openseadragon and need some help, if someone could answer it would be very kind. I have a java server-side with rest api, for getting tiles, from the big cell-level microscope photos. It responds me with raw data. And the main problem is that photos are split into channels. Not as simple as rgba, but is quite same. So the simple query looks like this: http://api/tile/{imageID}-{channelId}-{zoomID}-{xTileId}-{yTileId}. My boss asked me if i could colorize a photo on the front-end(to download 3(or more) tile sources at once with different channelId). I'm using openseadragon with angular.js. Could u please answer me, if it is possible within openseadragon, or i should go furter.
VoidVolker
@VoidVolker
Aug 04 2015 15:00
basically it possible
but, it be much easy use imagemagick or any other tool to convert channels into rgb image
on server
DanGart
@DanGart
Aug 04 2015 15:05
@VoidVolker unfortunately, imagemagick is not the case :( Users will be able to enable/disable channels like layers.
@VoidVolker sorry for my english(
VoidVolker
@VoidVolker
Aug 04 2015 15:07
you no need to replace all channels
you already have button to switch channel?
just add one more channel
it is simplest way
hard way - rewrite OSD render for canvas
DanGart
@DanGart
Aug 04 2015 15:09
i have to combine channels. Could be only r+g or maybe r+g+b or god knows what else. That's the case
VoidVolker
@VoidVolker
Aug 04 2015 15:10
hmm...
DanGart
@DanGart
Aug 04 2015 15:10
so, toggling a new channel should redraw whole canvas(divs) and implement as layers
one over another. And they should combine in proper way
VoidVolker
@VoidVolker
Aug 04 2015 15:11
anyway, i think, make this part on server is simplest way
DanGart
@DanGart
Aug 04 2015 15:11
dot 1 (RGB): 10,20,30. Dot 2: 20,20,20 - Should get 20,20,30 on this dot
as example
unfortunately, pictures volume can approach 1Tb. So this is not the point
VoidVolker
@VoidVolker
Aug 04 2015 15:12
1TB of puctures?
DanGart
@DanGart
Aug 04 2015 15:12
1 picture = 1Tb
VoidVolker
@VoidVolker
Aug 04 2015 15:12
full picture? what size?
DanGart
@DanGart
Aug 04 2015 15:12
cell-level very high quality photos, done with microscope
VoidVolker
@VoidVolker
Aug 04 2015 15:13
how you slice it to tiles?
DanGart
@DanGart
Aug 04 2015 15:14
They come to the backend already sliced
sample photo 1095630 x 939495 size 2875.94GB
VoidVolker
@VoidVolker
Aug 04 2015 15:15
wow
DanGart
@DanGart
Aug 04 2015 15:16
well, the server-side is already done. I have to think only about frontend
VoidVolker
@VoidVolker
Aug 04 2015 15:16
then, you need to rewrite render or develop plugin fo OSD
we need wait @iangilman - he know all about OSD )
DanGart
@DanGart
Aug 04 2015 15:17
ah, ok :) thanks, anyway
VoidVolker
@VoidVolker
Aug 04 2015 15:17
np )
DanGart
@DanGart
Aug 04 2015 15:19
but i believe that it's not that hard. I have to rewrite openseadragon a bit to support layers. Do you think it's possible?
Ian Gilman
@iangilman
Aug 04 2015 15:59
@DanGart Sounds like a great project! We do have a mechanism for manipulating tiles (they are stored as canvases), but not necessarily for combining multiple tiles into one. This is definitely something of interest, though (you're not the only one wanting to do something like this).
How is each channel stored? What kind of image file?
DanGart
@DanGart
Aug 04 2015 16:36
@iangilman each channel is a separate .tiff file, but serves-side serves it as a Raw Data to the frontend, I thought to do something like this - .src = "data:image/png;base64," + DataArray; We thought to make them like layers. To add 1 file over another.
So, the same photo instance gets photoshot several times. In different zoom, channels, etc.
Ian Gilman
@iangilman
Aug 04 2015 16:37
Wouldn't you want all the layers to share the same zoom?
DanGart
@DanGart
Aug 04 2015 16:37
sure thing
all layers should follow same zoom level and coordinates
Ian Gilman
@iangilman
Aug 04 2015 16:38
Cool
DanGart
@DanGart
Aug 04 2015 16:38
And i have to show this photos on the frontend, supporting to add different channels in real-time by user
Ian Gilman
@iangilman
Aug 04 2015 16:39
Well, since OpenSeadragon can layer multiple images on top of each other, you could certainly go that way. You'd probably want to customize the Drawer, though...I'm assuming you want the images to blend in more interesting ways than just simple transparency?
DanGart
@DanGart
Aug 04 2015 16:40
and a few more things like comparing few photos, so they should zoom and move simultaniously, making histogram for contrast, color, etc. And a few more options, but they will come later
Ian Gilman
@iangilman
Aug 04 2015 16:42
Another option would be to customize TiledImage or TileSource somehow so instead of one tile per tile area, you can load (and blend) many tiles per area (one for each layer).
DanGart
@DanGart
Aug 04 2015 16:42
indeed, they have to layer in some difficult way - so they can lighten with each other. for example - dot 1 (RGB): 10,20,30. Dot 2: 20,20,20 - Should get 20,20,30 on this dot
Should you recommend using canvas, or divs?
Ian Gilman
@iangilman
Aug 04 2015 16:43
Definitely Canvas
DanGart
@DanGart
Aug 04 2015 16:43
got you, thanks
Ian Gilman
@iangilman
Aug 04 2015 16:44
You'll probably have to write your compositing yourself (or find a library that does that)
And it'll have a performance impact
So the two ways I'm thinking you could do it are basically different parts of the pipeline. In OSD, we collect a bunch of tiles and then every frame of animation, we draw those tiles to the screen. So one option would be to manage the layering at the tile level, so once it's time to animate it's no more complicated than a regular Seadragon image. This would make zooming and panning just as fast. When the user wanted to adjust the layering, then you'd rework all the tiles.
DanGart
@DanGart
Aug 04 2015 16:47
and the other thing, in future it have to be implemented on IOS and android. :)
Ian Gilman
@iangilman
Aug 04 2015 16:48
The other option is you keep all the tiles separate and handle the layering with each frame as you draw them to the screen. This would probably be lighter on memory (since you wouldn't have to keep both pristine and modified copies of all the tiles), but also probably slower to animate (panning and zooming) because you're doing a lot more work for each frame.
Either way, OSD doesn't directly support this, but could be modified to.
The good news about mobile is that the screens are smaller so there are fewer pixels to manage, which improves memory and speed (which is good because those devices have less of both).
DanGart
@DanGart
Aug 04 2015 16:50
hah, i didn't thought about it. Great idea!
Thanks a lot for your support :) If a have some questions in future, may I ask you?
Ian Gilman
@iangilman
Aug 04 2015 16:52
Indeed...if you do decide to pursue one of those options, you'll likely need my help (or someone else in this forum), as you'll be digging around in the internals.
DanGart
@DanGart
Aug 04 2015 16:52
seems like a challenge
:D
Ian Gilman
@iangilman
Aug 04 2015 16:55
Everything is a challenge when your images are 1TB ;)
Rashmi Singhal
@rsinghal
Aug 04 2015 19:50
@iangilman Is there a way to temporarily disable the click event in OSD? I also tried setting a click event handler on .openseadragon-canvas and using preventDefault, but OSD is still picking it up
Mark Salsbery
@msalsbery
Aug 04 2015 20:11
@rsinghal the OpenSeadragonViewerInputHook plugin can help you intercept the event before the viewer sees it
Rashmi Singhal
@rsinghal
Aug 04 2015 20:14
i looked at it, but wouldn't that permanently change the click handler?
i just want to disable for a certain amount of time, and then reenable it
Ian Gilman
@iangilman
Aug 04 2015 20:18
@rsinghal do you just want to disable the click to zoom?
If so, just change viewer.zoomPerClick to 1 to disable and then back to 2 to re-enable
Rashmi Singhal
@rsinghal
Aug 04 2015 20:21
The issue is I'm creating a tooltip over the canvas, I tried zoomPerClick, but it's still causing the click to happen, which makes the tooltip redraw itself
Ian Gilman
@iangilman
Aug 04 2015 20:22
A custom tooltip or a built-in DOM tooltip?
Rashmi Singhal
@rsinghal
Aug 04 2015 20:22
but yes, it prevents the zooming, but there is still a click event
custom, qtip2
it's creating issues because a user can enter information in a form, and clicking outside of the tooltip causes the content to be lost and the tooltip itself to disappear and reappear
Ian Gilman
@iangilman
Aug 04 2015 20:24
Well, if you really need to kill the event, OpenSeadragonViewerInputHook may be your best bet...or at least take a look at its code.
Rashmi Singhal
@rsinghal
Aug 04 2015 20:24
i am going to see if i can prevent the content from being lost, but the tooltip flashing is not desirable
Ian Gilman
@iangilman
Aug 04 2015 20:25
Another option would be to put a div over the top of the viewer to catch all clicks before they get to the viewer. Then hide that div when you want clicks again.
Rashmi Singhal
@rsinghal
Aug 04 2015 20:26
Hmmm, I will look into that
Ian Gilman
@iangilman
Aug 04 2015 20:26
Cool. I'll let you know if I think of anything else
Rashmi Singhal
@rsinghal
Aug 04 2015 20:28
Thanks