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

BUG: ROI coordinates shifted in y-axis with respect to manually-drawn Ellipse #1125

Open
yzerlaut opened this issue Jun 5, 2024 · 1 comment

Comments

@yzerlaut
Copy link

yzerlaut commented Jun 5, 2024

Describe the issue:

Dear Suite2p developers,

I noticed a small shift in y-coordinates between the manually-drawn ROIs and the actual pixels used to define the ROI fluorescence. This shift seems proportional to the height of the ellipse. For thin pieces of dendrites with rotated ROIs, it can be quite problematic. You can find an example below.

Here is the selection in the manual_labelling GUI:
Pasted Graphic

Here is the selection in the main GUI:
Pasted Graphic 1
Note the fact that it's not centered anymore on the dendrite.

This is worst with rotations:
image
versus:
image

I re-did the ellipse coordinates calculation to fix the ROI pixel values (see yzerlaut@af26542).
I think it fixed it:

A few ellipses manually drawn:
Pasted Graphic 3

And their respective ROIs in the GUI:
Pasted Graphic 4

If this bug is reproduced by others, I could also do a PR.

Best,
yann

P.S. 1) Thank you very much for sharing and maintaining this amazing piece of software !
P.S. 2) Just to let you know. I am adding on my fork the python support for other ROI shapes (RectROI, PolyLineROI) in case you would be interested by a PR.

Reproduce the code example:

draw a ROI in "manual_labeling" GUI and note the y-shift in the ROI pixels

Error message:

No response

Version information:

v0.9.3.dev528+gc88e1ba.d20240604

Context for the issue:

This bug impedes to select pieces of thin dendritic segments.

@superwhat1
Copy link

Implemented the fix and it works great.
Thanks

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