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

Circular masks for intensity/tile features may be shifted by 1 pixel #1239

Open
petebankhead opened this issue Feb 22, 2023 · 0 comments
Open
Labels

Comments

@petebankhead
Copy link
Member

Bug report

Describe the bug
When comparing intensity features computed with square and circular masks using Show measurement map, I noticed that there seemed to be a slight shift.

Digging into code, the relevant bit is starts here.

Adding a line

new ImagePlus("Something", new FloatProcessor(w, h, pixelImage.getArray(false))).show();

makes it possible to visualize the image in ImageJ. The screenshot suggests there could be an issue of shifting, at least if the width and height of the region is an even number.

Screenshot 2023-02-22 at 17 25 32

If there is an odd number of pixels, the result looks ok:

Screenshot 2023-02-22 at 17 27 29

(The contrast was changed differently in each case, to highlight the excluded pixels with NaN values)

Expected behavior
No apparent shift, regardless of whether there is an even or odd number of pixels in the image.

Desktop (please complete the following information):

  • OS: All
  • QuPath Version: Probably all up to v0.4.x

Additional context
This shouldn't be addressed in an 0.0.x release, since it would change results. But the circular tiles calculation should be revisited for a major release, since 1 pixel could be a substantial shift if the region is small (e.g. a low-resolution tile).

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

No branches or pull requests

1 participant