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

Allow swc files without a soma to be loaded #62

Merged
merged 1 commit into from
May 2, 2024
Merged

Conversation

IgorTatarnikov
Copy link
Member

@IgorTatarnikov IgorTatarnikov commented May 2, 2024

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 https://forum.image.sc/t/brainrender-error-when-rendering-my-own-neuron-morphology/95389/5

What does this PR do?
Allows the load_from_swc and create_mesh functions to run when the provided swc file/Neuron object has no soma.

References

Please reference any existing issues/PRs that relate to this PR.

How has this PR been tested?

Tested using the user provided swc file, along with the standard brainrender swc test file. Both are able to be rendered without errors now.

Is this a breaking change?

No.

Does this PR require an update to the documentation?

No.

Checklist:

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

@IgorTatarnikov IgorTatarnikov requested a review from a team May 2, 2024 10:54
@adamltyson adamltyson requested review from adamltyson and removed request for a team May 2, 2024 10:57
@adamltyson
Copy link
Member

@IgorTatarnikov when I run it on the data without a soma, I get:

morphio._morphio.MissingParentError:
Sample id: 1 refers to non-existant parent ID: 0

Am I missing something?

@IgorTatarnikov
Copy link
Member Author

Hmm, that's odd. Which swc file are you using?

@adamltyson
Copy link
Member

wl3_local_registered.swc from the image.sc issue. Running it with the latest brainrender & this branch of morphapi:

from brainrender import Scene
from brainrender.actors import Neuron

scene = Scene()
scene.add(Neuron('wl3_local_registered.swc'))
scene.render()

@IgorTatarnikov
Copy link
Member Author

I'm able to run it with the same file. I'll try downloading the file again and running it in a fresh environment.

@IgorTatarnikov
Copy link
Member Author

I can't seem to replicate it, everything runs smoothly in a fresh environment.

@adamltyson
Copy link
Member

Ok finally after starting from scratch with everything, it works fine. No idea what's going on with my system.

@adamltyson adamltyson merged commit a3b1f4b into main May 2, 2024
22 checks passed
@adamltyson adamltyson deleted the no-soma-neuron branch May 2, 2024 15:46
@adamltyson
Copy link
Member

Will release and report back on image.sc.

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