Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird zoom factor vs. logical/physical/data-size #4

Closed
Jondeen opened this issue Mar 17, 2015 · 2 comments
Closed

Weird zoom factor vs. logical/physical/data-size #4

Jondeen opened this issue Mar 17, 2015 · 2 comments
Assignees

Comments

@Jondeen
Copy link

Jondeen commented Mar 17, 2015

Hi!

I'm attempting to get from logical distance to distance measured in data-level values. There are no helper functions for logical->data distance formats, so I tried using following:
physical->logic (screen pixels to fraction of image)
logic (as point offset from zero) ->datapoint.

Below are my results:

var distance=helper.physicalToLogicalDistance(150);

p=new OpenSeadragon.Point(distance,distance);
$.Point {
x: 0.0033450036795040473, 
y: 0.0033450036795040473, 
…}

siz=helper.logicalToDataPoint(p)
$.Point {x: 150, 
y: 195.61916018107618
…}

helper.getZoomFactor()
1

After double checking just now I realise that this is due to the "physicalToLogicalDistance" only looking up x-dimension. As width/height of the data-level image this gives a wrong logical distance for y. In order to look up y you, obviously, need to compare to the y-dimension.
Hence for a proper lookup I'd suggest separate physicalToLogicalDistanceY and physicalToLogicalDistanceX, or possibly a physicalToLogicalDistancePoints(Point A as vector from origo) returning EITHER a {w:__, h: __} object OR the diagonal. Maybe latter makes more sense.

Also a helper "physicalToDataDistance" actually makes more sense, since here only 1 number reflects both dimensions.

If I'm not entirely off the track here I'd be glad to submit a patch, but need to verify I'm not just wrong because of low blood sugar ;-)

@msalsbery
Copy link
Owner

Hi @Jondeen

I know this is ancient, sorry! Is this something I still need to look into in your opinion?

I'll keep this open until I get to it, but now that I'm modernizing my plugins I'm looking to prioritize issues a bit.

Cheers!

@msalsbery
Copy link
Owner

Closing this...

The new home for the OpenSeadragon Imaging plugins is here: https://github.com/openseadragon-imaging

If there's still issues, please re-post at the plugin's new home. It's about time this stuff gets fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants