-
Notifications
You must be signed in to change notification settings - Fork 0
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
Simulate rotation out of imaging plane with the Rotator #31
Conversation
…uired refactoring
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #31 +/- ##
==========================================
+ Coverage 43.89% 47.26% +3.36%
==========================================
Files 6 7 +1
Lines 631 677 +46
==========================================
+ Hits 277 320 +43
- Misses 354 357 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Just a few comments here and there. I could use some more information on the construction of the homography_matrix, why that specific form? From my understanding the current implementation adds a scaling factor in the second dimension based on cos(rotation_plane_angle)
, is that correct?
Might also be nice to add "noise/simulated activity" to the bright/dim cell objects. Add a flat random noise to simulate shot noise and then an underlying "ground truth" activity as well! Understand that this is outside of the scope of this PR.
Yes it is correct. Your comment makes me wonder if it is an overkill to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 LGTM!
Description
What is this PR
Why is this PR needed?
While working on finding the centre of rotation (see #30) I noticed that the rotating cells describe an ellipse and not a circle. This kind of artefact could be due to a mismatch between the plane of rotation and the imaging plane.
Therefore, to prove it I expand the Rotator class to create a new type of synthetic rotation movies.
You can notice in the max projection image that the trajectory of the cells is elliptical as expected.
Works also for rotations out of plane in another orientation:
And with shifted center of rotation:
This new feature could be described also as a "3D rotation".
I can now use the new Rotator to generate synthetic movies to build an improved derotation algorithm. It will come in a separate PR.
What does this PR do?
Further methods to Rotation class and related tests.
Renaming of classes:
Moves functions to fit an ellipse to a dedicated module (fit_ellipse.py)
References
See #26 #27
How has this PR been tested?
Made parametrised tests
Is this a breaking change?
No
Checklist: