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

fix: retrieving meshes for a region present in the onthology but absent in the annotation atlas #246

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

carlocastoldi
Copy link
Contributor

@carlocastoldi carlocastoldi commented Oct 5, 2023

Description

What is this PR
Bug fix

Why is this PR needed?
Sometimes you want to display some regions by selecting them in the onthology. However you don't always know if they have a corresponding mesh. An example is RSPd4 in Allen's CCFv3

What does this PR do?
Skip those problematic regions

How has this PR been tested?

import brainrender
atlas = brainrender.Atlas("allen_mouse_25um")
print(atlas.get_region("RSPd4", "RSPd5"))

the above code crashes without this PR. With it, it just adds region RSPd4

Is this a breaking change?

No

Does this PR require an update to the documentation?

No

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@adamltyson
Copy link
Member

Thanks @carlocastoldi!

@adamltyson adamltyson merged commit 2529009 into brainglobe:master Oct 5, 2023
1 check failed
@carlocastoldi
Copy link
Contributor Author

sorry for the dumb question, but what's the release cycle like for brainrender? When can I approximately expect to update it in my project and have the fix in?
Thank you in advance!

@adamltyson
Copy link
Member

Hey @carlocastoldi not a dumb question at all. However please see #247. brainrender requires a considerable amount of work before the next release on PyPI.

We hope to update the project and move to a more regular release cycle soon, but there is no ETA as yet.

@carlocastoldi
Copy link
Contributor Author

That's awesome. Thank you a lot for the clarification!
Hope I can help in future, perhaps ^^

@marcomusy
Copy link
Contributor

Related to #247 I think I remember that some of the problems originated from some breaking changes in vedo.

This is again a rather critical moment because since about a month or so I'm planning to restructure some class inheritances which would almost certainly affect brainrender.
At this very moment I would suggest to keep it on hold and not trying to adapt it to the vedo 2023.4.6, until I make up my mind about the API changes.

I will let you know "soonish" how things will evolve!

Thanks for your patience.

@adamltyson
Copy link
Member

Thanks @marcomusy, much appreciated. Please do let us know.

@marcomusy
Copy link
Contributor

So the vedo restructuring is basically completed!
I'm quite happy with the result because now it's much better organised, ..and most of the examples are unchanged!
This means the API is pretty much the same.
You can already start playing with it if you wish in restruct_mem branch with:

git clone https://github.com/marcomusy/vedo.git
cd vedo
git checkout restruct_mem
pip install -e .
vedo --info

and you should now have vedo 2023.5.0+dev17a.

The main difference is that now the Mesh (or Volume) object is no more a subclass of vtkActor but it's an independent object containing a vtkActor which can be still accessed by class member .actor.
So plotter.actors becomes plotter.objects.
Analogously the underlying vtkPolydata (or vtkImagedata) are accessible by class member .dataset. (in principle you don't need to access neither of the 2).
Check out vedo/docs/changes.md for more details.

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.

None yet

3 participants