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

ImageStack.getRoi() inconsistent behaviour #247

Open
mdoube opened this issue Apr 26, 2024 · 1 comment
Open

ImageStack.getRoi() inconsistent behaviour #247

mdoube opened this issue Apr 26, 2024 · 1 comment

Comments

@mdoube
Copy link

mdoube commented Apr 26, 2024

final Rectangle r = stack.getRoi();

Used to give a Rectangle either of the bounds of the ROI if one was set or with the dimensions and origin of the whole image.

You could then use r.x or r.width regardless of whether there was an ROI or not, to scan pixels inside the ROI (if one was set) or the whole image (if no ROI was set).

Recently this broke so that this behaviour was not maintained leading to legacy code not working any more.

I fixed this for BoneJ's Slice Geometry by using ImagePlus.getRoi().getBounds() instead of the ImageStack-based methods.
bonej-org/BoneJ2@8e91419

@rasband
Copy link
Member

rasband commented Apr 26, 2024

As far as I know, there have been no changes to the ImageStack.getRoi() method.

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