Cytomine-Web-UI icon indicating copy to clipboard operation
Cytomine-Web-UI copied to clipboard

Grid lines when displaying .svs images

Open alan-dot-oneill opened this issue 4 years ago • 7 comments

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 0 63

Magnification 1.25x magnification 1 25

Magnification 2.5x magnification 2 5

Magnification 5x magnification 5

alan-dot-oneill avatar Sep 17 '20 18:09 alan-dot-oneill

Thanks for the ticket. For information, these yellow lines are not displayed when you get tiles with the external clients (scripts).

geektortoise avatar Sep 22 '20 08:09 geektortoise

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 :-)

urubens avatar Sep 22 '20 09:09 urubens

Hope there can be a way to solve this problem

PeterCH-NY avatar Sep 20 '21 05:09 PeterCH-NY

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

Aileron64 avatar Jun 08 '22 15:06 Aileron64

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 ?

geektortoise avatar Jun 30 '22 08:06 geektortoise

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

Aileron64 avatar Jul 11 '22 23:07 Aileron64

Is there a possibility that the alpha for the pixels on the edge of each segment in the grid is being miscalculated?

Aileron64 avatar Jul 13 '22 13:07 Aileron64