These are chat archives for openseadragon/openseadragon

8th
Sep 2016
John Hoffer
@thejohnhoffer
Sep 08 2016 02:16
Done and tested! vShader and fShader take either filenames or files.
Toke Eskildsen
@tokee
Sep 08 2016 07:46
@altert Okay, it took me quite some time to understand how Tween.js integrates (I am not at all proficient with JavaScript), but I finally got a simple rotator to work ( http://labs.statsbiblioteket.dk/nrtmosaic/test_rotate1.html ). Now that I understand what it does, Tween.js is really very elegant and I think I will let that control the demo-mode fully instead of letting OpenSeadragon do any animation steps.
Alexey Tikhonov
@altert
Sep 08 2016 07:48
@tokee cool! glad it worked for you
Toke Eskildsen
@tokee
Sep 08 2016 07:49
Playing around with zooming at the same time did overwhelm my Firefox on my laptop a bit, delaying deeper-tiles resolving. I expect I'll have to experiment with zoom-and-pan-speed to hit a sweet spot between transition time and display quality.
Toke Eskildsen
@tokee
Sep 08 2016 07:58
Is there some kind of metric I can hook into to get an idea of how many tiles are fully resolved? It would be nice to let the demo rotate-pan-zoom slow down, if the browser/bandwidth cannot keep up.
Alexey Tikhonov
@altert
Sep 08 2016 07:58
sorry, don’t know this area very well
John Hoffer
@thejohnhoffer
Sep 08 2016 13:26
Is there a built-in option to hold the previous sequence for just a few milliseconds more to prevent the blackout between sequences in sequence mode?
John Hoffer
@thejohnhoffer
Sep 08 2016 13:48
Or as an allternative, with full-multi-image, can I hide and show each of the images at will?
Samuel Allen
@dehuszar
Sep 08 2016 16:00
Hi all. Quick question (hopefully). I'm successfully using OSD in an application I'm working on, and have refashioned the svg-overlay plugin in an Ember component. I'm trying to create overlays in areas of an image when zoomed and panned to a particular point, but am having trouble with a couple of things. One, the svg element is the same size as my viewport, but if I set a polygon point to 0.5,0.5 the point appears halfway across the width (which makes sense) but more than halfway across the height. It appears the 1 = 100% ratio is the same for the x or the y axis regardless of height of the viewport. Anyone know why this might be?
Ian Gilman
@iangilman
Sep 08 2016 16:15
@thejohnhoffer Excellent (paths vs strings) :)
@thejohnhoffer Unfortunately sequence mode isn't very full featured. I think for the future it would be good to have plugins that support more advanced things like sequence mode. Probably all of that should be built on full multi-image, which is much more powerful than the current sequence mode
With full multi-image you have complete control over image placement and visibility
...so you can bring a new image in and wait until it loads before removing the old image, for instance
You can find some examples of stuff like that here: http://codepen.io/collection/APoyjJ/#
@tokee On the master branch there is now a flag on TiledImage that tells whether all tiles for the current view have been loaded. If you want to find out what percentage of tiles for the current view have been loaded, there's no API for that, but you could dig around a bit in the data and get it... for instance finding out how many tiles are currently being loaded from the ImageLoader, though you'll have to poke at non-public properties
Ian Gilman
@iangilman
Sep 08 2016 16:22
@dehuszar If your image is exactly square then it defaults to a width of 1 and a height of 1. If the aspect ratio is different, then the height is what fluctuates. An image that's twice as tall as it is wide would have a width of 1 and a height of 2. For more info on coordinates, see: http://openseadragon.github.io/examples/viewport-coordinates/
John Hoffer
@thejohnhoffer
Sep 08 2016 16:23
@iangilman That sounds great! I think multi-image mode will meet my needs entirely! I'll just put the next in sequence into a hidden image. Thank you!
Ian Gilman
@iangilman
Sep 08 2016 16:23
:thumbsup:
Samuel Allen
@dehuszar
Sep 08 2016 16:27
@iangilman Thanks! That's may just get me unstuck. :smile:
Ian Gilman
@iangilman
Sep 08 2016 16:33
:)
Be sure and share your projects when you're done so we can add them to the "In the Wild" page! (and so everyone here can appreciate them)
Samuel Allen
@dehuszar
Sep 08 2016 16:42
For sure!
Toke Eskildsen
@tokee
Sep 08 2016 16:59
@iangilman I think the "are we there yet" flag will help a lot. I can use it to ensure that the destination of a jump will be fully visible for some time before initiating another jump.
Ian Gilman
@iangilman
Sep 08 2016 17:00
Yes, sounds good. There's also an event for when it changes (but keep in mind that it will change multiple times during an animation as new tiles are revealed)
Toke Eskildsen
@tokee
Sep 08 2016 17:05
The project I am working on is public and semi-permanent, meaning that it is on my institutions labs domain: http://labs.statsbiblioteket.dk/zoom/ (looks boring at first, but try zooming). We would appreciate being mentioned on the In the Wild-page.
Samuel Allen
@dehuszar
Sep 08 2016 17:12
@tokee Cool! Infinite zoom.
Toke Eskildsen
@tokee
Sep 08 2016 17:13
@dehuszar Ah, sadly no. I estimate that will take me several nights of hacking to get right. But I would really like to. Only 2 full levels of mosaic currently.
Ian Gilman
@iangilman
Sep 08 2016 17:14
It's still really cool!
Toke Eskildsen
@tokee
Sep 08 2016 17:14
Thanks.
Ian Gilman
@iangilman
Sep 08 2016 17:15
@tokee Would you be up for adding it to the "In the Wild" page? Make a pull request on this file: https://github.com/openseadragon/site-build/blob/master/www/in-the-wild.html
Toke Eskildsen
@tokee
Sep 08 2016 17:15
Yes, of course, @iangilman. Will do it later tonight.
Ian Gilman
@iangilman
Sep 08 2016 17:16
Excellent, thanks!
Samuel Allen
@dehuszar
Sep 08 2016 17:26
@iangilman Another quick one if I may. I'm finding that when I inject a new overlay into the openseadragon-canvas element the zoom and panning resets. Is there a way to prevent that / what might be causing that behavior?
Ian Gilman
@iangilman
Sep 08 2016 17:31
@dehuszar That's very strange; that shouldn't be happening. Is this with the SVG overlay?
Samuel Allen
@dehuszar
Sep 08 2016 17:32
@iangilman ....sort of. I'm using Ember components and not D3, so I basically took the guts of the overlay and ported it over to an Ember Component structure. It's probably something I've done that I didn't fully understand. Just wanted to see if it might have been known behavior
Ian Gilman
@iangilman
Sep 08 2016 17:35
It's not. Maybe Ember is rebooting the viewer somehow?
Samuel Allen
@dehuszar
Sep 08 2016 17:36
Yeah, I may have my resize handler in the wrong component lifecycle hook
Ian Gilman
@iangilman
Sep 08 2016 17:36
Cool... good luck!
Samuel Allen
@dehuszar
Sep 08 2016 17:36
thx
John Hoffer
@thejohnhoffer
Sep 08 2016 19:49
Hi there- @iangilman - I'm using two tilesources with an opacity of 0.6 for the top tile. In OSX Safari I'm having trouble using openSeadragon v2.2.1 while the old demo in openSeadragon v2.1.0 works just fine.
Specifically, the top transparent tile disapears when zooming using the latest openSeadragon (2.2.1) in the latest Safari versions.
Ian Gilman
@iangilman
Sep 08 2016 20:06
@thejohnhoffer Interesting. By top tile I assume you mean top TiledImage. I don't think I've heard of this issue... how is it on other browsers? Do you have a link you can share?
John Hoffer
@thejohnhoffer
Sep 08 2016 20:07
Yes, the top TiledImage. I posted links using openSeadragon v2.2.1 (Bad) and using in openSeadragon v2.1.0 (Good).
This problem is the same in iOS/OSX safari and Microsoft Edge.
Ian Gilman
@iangilman
Sep 08 2016 20:08
Oh, gotcha... you were being too clever ;) I assumed those were links to the releases
John Hoffer
@thejohnhoffer
Sep 08 2016 20:09
Yeah, I was worried that would happen- woops.
But I'm testing other browsers now.
It works fine in Chrome on osx, ios, and windows.
Ian Gilman
@iangilman
Sep 08 2016 20:10
They both look identical to me in Mac Safari... I assume for you flipping back and forth between the two looks dramatically different?
(Both identical in Mac Chrome as well)
John Hoffer
@thejohnhoffer
Sep 08 2016 20:10
Only if I'm zooming in.
So they look fine on load, but the overlay TiledImage disappears when I click the plus button or scroll.
Ian Gilman
@iangilman
Sep 08 2016 20:11
Gotcha... sorry, just getting back from lunch, obviously not reading very well!
John Hoffer
@thejohnhoffer
Sep 08 2016 20:11
No worries- it took me a few weeks to notice it myself!
This is what I get for always developing in chrome...
Ian Gilman
@iangilman
Sep 08 2016 20:14
:)
You might try smoothTileEdgesMinZoom: Infinity in your options (on 2.2.1)
...just to rule that out
John Hoffer
@thejohnhoffer
Sep 08 2016 20:16
I just quickly made that edit...
Ian Gilman
@iangilman
Sep 08 2016 20:17
You might take a look at openseadragon/openseadragon#381 as well for possible connections...
John Hoffer
@thejohnhoffer
Sep 08 2016 20:17
No luck on smoothTileEdgesMinZoom
Ian Gilman
@iangilman
Sep 08 2016 20:17
Anyway, sounds like you've found a new bug. Can you write it up as an issue?
John Hoffer
@thejohnhoffer
Sep 08 2016 20:17
Sure!
Ian Gilman
@iangilman
Sep 08 2016 20:18
Cool, thanks for trying that at least.
...and thanks for finding/filing :)
This issue openseadragon/openseadragon#952 is related to smoothTileEdgesMinZoom, but probably not relevant for you since it didn't make any difference
John Hoffer
@thejohnhoffer
Sep 08 2016 20:19
Yeah- no problem. I can also try to replicate the bug with a smaller image (right now I'm using a custom tileSource with a lot of tiles)
Ian Gilman
@iangilman
Sep 08 2016 20:19
Anyway, would be interesting to know if it matters how many images there are, and if the opacity makes a difference, etc.
Yeah... knowing if the size of the image makes a difference would be good too
Those are pretty images by the way! What are they of?
John Hoffer
@thejohnhoffer
Sep 08 2016 20:20
They're connectomics data! Electron Microscope images of mouse neurons.
Of course, well, they unfortunately aren't those colors in real life.
Ian Gilman
@iangilman
Sep 08 2016 20:22
That would be pretty sweet ;)
Cool stuff
John Hoffer
@thejohnhoffer
Sep 08 2016 20:22
Thanks!
Samuel Allen
@dehuszar
Sep 08 2016 21:43
@iangilman I've been looking at the viewport-coordinates example and am getting a little lost in the abstractions. I'm trying to figure out where I am in the overall image when I'm zoomed/panned to a particular point, and be able to convert the values back to x, y coordinates like 0.5,0.5 that can be used in the SVG. I've tried most of the conversion functions listed in the viewport api methods list, but I'm missing a step, or doing something wrong.
Ian Gilman
@iangilman
Sep 08 2016 21:45
@dehuszar Are you just dealing with a single image? If so, one way to simplify things is to give it a width and height in the viewport that matches the actual number of pixels in the image... then you can place your SVG according to the image coordinates
Samuel Allen
@dehuszar
Sep 08 2016 21:45
I think one particular point of confusion is from the svg-overlay demo page. That plugin uses the following statement viewer.viewport.pixelFromPoint(new OpenSeadragon.Point(0, 0)). Is this an absolute point at the top of the image, or is it relative to what's currently visible?
@iangilman yes single image
Ian Gilman
@iangilman
Sep 08 2016 21:46
The "point" in "pixelFromPoint" is in viewport coordinates, so yes it's the top left of the image no matter where it's panned to
The "pixel" is in web coordinates, so it could be anywhere in your window or even off of it, depending on where things have been panned
Samuel Allen
@dehuszar
Sep 08 2016 21:47
what would I then use to get the relative top, left coordinates?
Ian Gilman
@iangilman
Sep 08 2016 21:47
viewer.viewport.getBounds() gives you a rectangle of the current viewport (where you are zoomed/panned to) in viewport coordinates
When you say relative, which coordinate system? Relative to what?
Samuel Allen
@dehuszar
Sep 08 2016 21:48
my current pan and zoom
Ian Gilman
@iangilman
Sep 08 2016 21:49
Sounds like you want getBounds
Samuel Allen
@dehuszar
Sep 08 2016 21:49
so if I've zoomed in to a particular point of an image and want to drop an overlay in the dead center, how do I know where the relative center is
Cool, I'll try that. Thanks!
Ian Gilman
@iangilman
Sep 08 2016 21:51
Yeah, viewer.viewport.getBounds().getCenter() will give you the center of the current view in viewport coordinates, and viewer.addOverlay takes viewport coordinates, so that should be perfect
Samuel Allen
@dehuszar
Sep 08 2016 21:51
Thanks!
Erik Sjölund
@eriksjolund
Sep 08 2016 22:21
Here is an online demo of an gene expression viewer:
https://eriksjolund.github.io/osd-spot-viewer-webpack-build/build2/
To try it out, click
"Open some example data files and layouts"
(It should at least work with Google Chrome and Firefox in Ubuntu 16.04). Software design: All image tiles are packed into one file together with the gene expression measurement data.
Ian Gilman
@iangilman
Sep 08 2016 22:55
@eriksjolund :thumbsup: