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

Update hemisphere slicing #375

Merged
merged 2 commits into from
Aug 16, 2024
Merged

Update hemisphere slicing #375

merged 2 commits into from
Aug 16, 2024

Conversation

IgorTatarnikov
Copy link
Member

Before submitting a pull request (PR), please read the contributing guide.

Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
See the discussion in brainglobe/brainglobe-atlasapi#330

What does this PR do?
If the atlas is marked as symmetrical in the metadata the midpoint is now calculated by taking the mean of the root mesh bounds for each axis. If the atlas isn't marked as symmetrical the previous behaviour is maintained.

References

brainglobe/brainglobe-atlasapi#330

How has this PR been tested?

Tested locally by visual inspection.
For an asymmetric atlas:

scene = Scene(atlas_name="mpin_zfish_1um")
scene.add_brain_region("hindbrain", hemisphere="right")
scene.add_brain_region("forebrain", hemisphere="left")
scene.render()

For symmetric atlases:

scene = Scene(atlas_name="allen_cord_20um")
scene.add_brain_region("WM", hemisphere="left")
scene.render()
scene = Scene(atlas_name="allen_mouse_25um")
scene.add_brain_region("CTX", hemisphere="left")
scene.render()

Is this a breaking change?

No

Checklist:

  • The code has been tested locally
  • The code has been formatted with pre-commit

@IgorTatarnikov IgorTatarnikov requested a review from a team August 15, 2024 10:50
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.06%. Comparing base (9cd07c8) to head (89ffcaf).
Report is 1 commits behind head on main.

Files Patch % Lines
brainrender/scene.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #375      +/-   ##
==========================================
- Coverage   88.13%   88.06%   -0.08%     
==========================================
  Files          27       27              
  Lines        1214     1215       +1     
==========================================
  Hits         1070     1070              
- Misses        144      145       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@IgorTatarnikov IgorTatarnikov removed the request for review from a team August 15, 2024 12:51
@IgorTatarnikov IgorTatarnikov marked this pull request as draft August 15, 2024 12:51
@adamltyson
Copy link
Member

Thanks @IgorTatarnikov! This looks good to me, but I won't review until it's marked as "ready for review".

I checked, and it also fixes this image.sc issue.

@IgorTatarnikov
Copy link
Member Author

I unmarked it because this approach fails with the new axolotl atlas, so I was going to do some more investigating!

@IgorTatarnikov IgorTatarnikov marked this pull request as ready for review August 15, 2024 17:03
@IgorTatarnikov
Copy link
Member Author

This fix works appropriately if the axolotl and other asymmetric atlases have the correct metadata tag. I've opened brainglobe/brainglobe-atlasapi#359 to track this issue. However, I believe this PR is ready to go in.

@adamltyson
Copy link
Member

Great, thanks @IgorTatarnikov. I'll merge this then release.

@adamltyson adamltyson merged commit 242dad8 into main Aug 16, 2024
11 of 13 checks passed
@adamltyson adamltyson deleted the fix-cord-midplane-bug branch August 16, 2024 08:43
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

Successfully merging this pull request may close these issues.

2 participants