catmaid / CATMAID

Collaborative Annotation Toolkit for Massive Amounts of Image Data
https://catmaid.org
GNU General Public License v3.0
182 stars 56 forks source link

[BUG] N5 image block source possibly broken by inconsistent block sizes across scale levels #2222

Open clbarnes opened 2 years ago

clbarnes commented 2 years ago

Short description

When blocks are different sizes, the bottom level renders fine, but other levels either have each block letterboxed or do not render at all.

To reproduce

It works fine in

More information

My suspicion is that somewhere, either the database-hardcoded tileWidth and tileHeight, or the s0 block shape, is being used to calculate which block to fetch and where to put it. An XY-smaller block being painted into an XY-larger hole would explain the letterboxing. Selecting which block to use based on incorrect block sizing would be more wrong the higher the scale level, which is why higher scale levels wouldn't show up at all.

It's more likely to be the s0 size which is being used, as changing the mirror's tile width/height in the admin panel does not seem to affect this bug.

Having differently-sized blocks is useful if you're aiming for blocks of a consistent real world size while downscaling anisotropic pixels towards isotropy. For example, igor's bottom scale level has resolution 5,5,35, and uses the downscaling factors

1,1,1|2,2,1|4,4,1|8,8,1|16,16,2|32,32,4|64,64,8|128,128,16|256,256,32|512,512,64|1024,1024,128

to achieve pixel near-isotropy at scale 3, then isotropically downscales by powers of 2 from there.