Cytomine-Web-UI
Cytomine-Web-UI copied to clipboard
Grid lines when displaying .svs images
When .svs images are displayed at lower magnification levels, they appear to have faint grid lines. I do not see these line when the magnification is increased to 5x or higher. The lines appear whether or not digital zoom is on. These lines don't appear when the image is in .ndpi or .jpg format. The images below are from screenshots of the browser taken at different magnification levels.
Magnification 0.63x
Magnification 1.25x
Magnification 2.5x
Magnification 5x
Thanks for the ticket. For information, these yellow lines are not displayed when you get tiles with the external clients (scripts).
Hi,
I've also noticed these lines with SVS files. IMHO, it's a backend-related issue. It would be great to check if the underlying tile images at problematic zoom levels have these yellow lines or not. An other interesting check would be to see if the tiles have the good size (256x256, except on borders).
According to https://openslide.org/formats/aperio/ SVS files uses 240x240 tiles and a zoom factor of 4 while Cytomine uses 256x256 tiles and a zoom factor of 2.
The computation of intermediate zoom levels are computed on the fly apparently here: https://github.com/cytomine/iipsrv/blob/c794ce2e89611504217eb386ae1bff312eb264dc/src/OpenSlideImage.cc#L277
Maybe a rounding issue ? Some overflow somewhere ? These are some tracks to investigate :-)
Hope there can be a way to solve this problem
I think I fixed it by updating line 232 of OpenSlideImage.cc https://github.com/cytomine/iipsrv/blob/c794ce2e89611504217eb386ae1bff312eb264dc/src/OpenSlideImage.cc#L232
destPixel[0] = 255 * sourcePixel[2] / a;
destPixel[1] = 255 * sourcePixel[1] / a;
destPixel[2] = 255 * sourcePixel[0] / a;
However I don't have access to many other image types that it could possibly effect
Hello,
In the case of CMU-1.svs, the a
value is 255 so not concerned by your fix
https://github.com/cytomine/iipsrv/blob/c794ce2e89611504217eb386ae1bff312eb264dc/src/OpenSlideImage.cc#L220
On which image did you test ?
Sorry, I've tested it on a lot of images, (including CMU-1.svs) at this point now with no issues, unfortunately if it doesn't work then I don't know enough about the logic to figure out why
Is there a possibility that the alpha for the pixels on the edge of each segment in the grid is being miscalculated?