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

Pan and Zoom issue with segmentation on image with non-square pixels #1176

Closed
3 tasks
l-donnelly opened this issue Feb 13, 2020 · 4 comments
Closed
3 tasks
Labels
Bug: Verified 🐛 Bug reported, reproducible, and verified.

Comments

@l-donnelly
Copy link

Prerequisites

  • Which version are you using? (Is it latest?)
    yes.
  • Are you reporting to the correct repository?
    yes.
  • Did you search existing issues? (Were any related?)
    not that I could see.

Description

The semi-transparent, filled-in sections of a segmentation are not moving consistently with the solid segmentation boundary or the underlying image with non-square pixels.

Steps to Reproduce the issue

  1. When I apply the brush tool using the left mouse button to create a segmentation
  2. Then use the middle mouse button to pan or the left mouse button to zoom
  3. The semi-transparent pixels in the segmentation do not move consistently with the segmentation boundary or the base image.

Expected behavior: The segmentation boundary and semi-transparent infill should undergo the same same translation, providing an accurate view of which pixels have been highlighted.

Actual behavior: The boundary maintains it's relative position with the underlying image correctly while the filled in pixels don't maintain there position along the axis with the greater pixel dimension.

CodeSandbox With Reproduction of Issue:

@dannyrb
Copy link
Member

dannyrb commented Feb 13, 2020

CC: @JamesAPetts

Thank you for the reproduction!

@dannyrb dannyrb added the Bug: Verified 🐛 Bug reported, reproducible, and verified. label Feb 13, 2020
@MickeyMiao7
Copy link
Contributor

It looks like the issue occurs when the values of rowPixelSpacing and columnPixelSpacing are different.
I spent some time trying to find out where the problem is but failed. Is there any insight about it? Is it caused by that the renderFill function calculates the coords wrongly?

@JamesAPetts
Copy link
Member

JamesAPetts commented Feb 29, 2020

@MickeyMiao7 Thanks for the report. It'll be this function that is causing issues:

I.e. incorrect translation. The whole renderFill function has no mention of rowPixelSpacing and columPixelSpacing, so some correction factors may need to be introduced to fix this. I'd be happy to review a PR if you are willing to take a stab at the issue.

MickeyMiao7 added a commit to iaerac/cornerstoneTools that referenced this issue Mar 2, 2020
jianfei added a commit to iaerac/cornerstoneTools that referenced this issue Mar 2, 2020
fix cornerstonejs#1176 Pan and Zoom issue with segmentation on image with non-square pixels
@MickeyMiao7
Copy link
Contributor

MickeyMiao7 commented Mar 2, 2020

@MickeyMiao7 Thanks for the report. It'll be this function that is causing issues:

I.e. incorrect translation. The whole renderFill function has no mention of rowPixelSpacing and columPixelSpacing, so some correction factors may need to be introduced to fix this. I'd be happy to review a PR if you are willing to take a stab at the issue.

Thanks you for the prompt reply and insight @JamesAPetts !
I have submitted PR #1183
Plz take a look if you have time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Verified 🐛 Bug reported, reproducible, and verified.
Projects
None yet
Development

No branches or pull requests

4 participants