girder / large_image

Python modules to work with large multiresolution images.
http://girder.github.io/large_image/
Apache License 2.0
190 stars 41 forks source link

Explaining Offset of method TileSource.__xyzInRange() #1548

Closed alevangel closed 2 months ago

alevangel commented 2 months ago

Why in the method _xyzInRange of the TileSource class the offstet is calculated in this way? offsetx = x * self.tileWidth * scale

I was expecting to see a sum, rather than a multiplication. offsetx = (x + self.tileWidth) * scale

Reference here: https://github.com/girder/large_image/blob/2ac58341d5c59d163ed4ddfce0b424ac97950da3/large_image/tilesource/base.py#L1452C1-L1453C1

alevangel commented 2 months ago

Just realized that x and y in getTile are not in pixels, but the col/row numebrs (so int)