Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSPS coordinates off by 1/2 pixel dimension #338

Open
seandoyle opened this issue Oct 4, 2022 · 2 comments
Open

GSPS coordinates off by 1/2 pixel dimension #338

seandoyle opened this issue Oct 4, 2022 · 2 comments

Comments

@seandoyle
Copy link

seandoyle commented Oct 4, 2022

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
Copy link
Author

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.

@nroduit
Copy link
Owner

nroduit commented Oct 9, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants