Weasis icon indicating copy to clipboard operation
Weasis copied to clipboard

GSPS coordinates off by 1/2 pixel dimension

Open seandoyle opened this issue 2 years ago • 2 comments

According to the DICOM standard - a the pixel coordinates in a GSPS identify the upper left corner of each pixel. Weasis renders graphic overlays interpreting the pixel coordinates as the center of each pixel.

This is a bit easier to see if you invert the LUT and zoom in for details. Weasis draws the lines neatly in the center of the pixels: Weasis_Inverted_Corner while Osirix (and Purview) draw them on the left and upper borders of the pixels: Osirix_Inverted_Corner

I believe that drawing the GSPS POLYLINEs in the middle of the pixels is incorrect.

To reproduce:

  1. Load the attached synthetic DICOM image and GSPS in your viewer from the attached zip file.
  2. Display the GSPS for this image.
  3. Zoom in to see the how the coordinates of the overlays are positioned on top of the pixel data.

Within the GSPS - the square uses these coordinates: (0070,0022) FL 15\15\15\111\111\111\111\15\15\15 # 40,2-n Graphic Data and the grid pattern on the image pixel data is on a 16 pixel grid (0, 15, ..., 111, 127) in both directions. So - the square in the GSPS should overlap the grid on the image pixel data.

GSPS_Grid_Test.zip

seandoyle avatar Oct 04 '22 14:10 seandoyle

Note that this issue might not be very important for images with high resolution - but for lower resolution images that are interpolated to a larger size the visual differences are very noticeable.

seandoyle avatar Oct 06 '22 14:10 seandoyle

Thanks for reporting this issue. Unfortunately, I can't deal with this topic right now because there are already too many open topics regarding the time I can devote to this project.

However, if I remember correctly, the points of the graphics are in the center because the initial implementation (in xml) was designed this way mainly because the zoom management is always centered. So it's easier to work with points in the center of the pixels and also when the thickness of the line is changing. With DICOM PR, there is a 1/2 pixel shift.

I'm going to leave this ticket open and see what can be done the next time I need to change things related to DICOM PR.

nroduit avatar Oct 09 '22 16:10 nroduit