-
Notifications
You must be signed in to change notification settings - Fork 9
Slab slice selection #124
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
base: main
Are you sure you want to change the base?
Slab slice selection #124
Conversation
for more information, see https://pre-commit.ci
Co-authored-by: Igor Tatarnikov <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…be/brainglobe-registration into target_selection_widget
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #124 +/- ##
==========================================
+ Coverage 92.30% 92.54% +0.24%
==========================================
Files 15 15
Lines 1221 1355 +134
==========================================
+ Hits 1127 1254 +127
- Misses 94 101 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
IgorTatarnikov
left a comment
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.
Works great out of the box, I have some more conceptual questions before I dive deeper into the code.
Also, perhaps we should explore now optimising the pitch/yaw/roll at all! This is much less of an issue in 3D as elastix will account for that as long as the subvolume is small enough. Could we try optimising just the start z-plane and end z-plane, by running a quick affine registration of the first slice with MI as the target. This should speed up the process significantly, we can then extract a slab from the atlas with a bit of a fudge factor in terms of atlas position (an extra 5 planes on each side) and then use that as the registration target?
| result_first = run_bayesian_generator( | ||
| atlas_image, | ||
| first_slice, | ||
| params["z_range"], | ||
| params["pitch_bounds"], | ||
| params["yaw_bounds"], | ||
| params["roll_bounds"], | ||
| params["init_points"], | ||
| params["n_iter"], | ||
| params["metric"], | ||
| params["weights"], | ||
| ) | ||
|
|
||
| try: | ||
| while True: | ||
| next(result_first) | ||
| progress_i += 1 | ||
| yield {"progress": progress_i} | ||
| except StopIteration as stop: | ||
| final_first = stop.value | ||
|
|
||
| logging.info( | ||
| "\nBayesian slice detection for the last slice in the slab..." | ||
| ) | ||
|
|
||
| result_last = run_bayesian_generator( | ||
| atlas_image, | ||
| last_slice, | ||
| params["z_range"], | ||
| params["pitch_bounds"], | ||
| params["yaw_bounds"], | ||
| params["roll_bounds"], | ||
| params["init_points"], | ||
| params["n_iter"], | ||
| params["metric"], | ||
| params["weights"], | ||
| ) |
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.
I wonder if there's an elegant way to provide separate z_ranges or even perhaps completely separate parameters for the start and end slice of the slab?
What is this PR
What does this PR do?
Allows for automated slice selection to match each slice in a slab to the optimal atlas slice.
References
#98
How has this PR been tested?
Tests added to
test_registration_widget.py.Is this a breaking change?
No.
Does this PR require an update to the documentation?
Yes.
Checklist: