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

Handle long cell/section names #15

Open
Helveg opened this issue Jan 13, 2021 · 4 comments
Open

Handle long cell/section names #15

Helveg opened this issue Jan 13, 2021 · 4 comments

Comments

@Helveg
Copy link
Contributor

Helveg commented Jan 13, 2021

Steps to reproduce:

  • pip install dbbs-models
  • Open a Python shell
> from dbbs_models import PurkinjeCell
# Basically uses Import3D to load an ASC morphology file
> pc = PurkinjeCell()
> from blenderneuron import neuronstart
  • Open Blender, select the soma section in the cell group objects, press "Import Cell Groups to Blender"

image

@Helveg
Copy link
Contributor Author

Helveg commented Jan 13, 2021

When I try to create a minimally reproducible example I can in fact import the cell groups if I directly use Import3D.

@JustasB
Copy link
Owner

JustasB commented Jan 14, 2021

Hi @Helveg,

Thanks for reporting the issue -- I was able to reproduce it.

The underlying cause is the limit on the length of blender object names. I will work on a long term fix, but I found a workaround that you could use in the meantime.

  1. Create a dummy class that wraps one of the dbbs cell classes (this shortens the name of the cell in Blender), e.g.:
import dbbs_models
class PurkinjeCellDummy(dbbs_models.purkinje_cell_models.PurkinjeCell): pass
  1. Instantiate the cell using the dummy class, e.g. pc = PurkinjeCellDummy()
  2. Start BlenderNEURON in NEURON with from blenderneuron import neuronstart and import the group

I get this with the above steps:

image

@JustasB
Copy link
Owner

JustasB commented Jan 14, 2021

Without looking closer at the morphology points, I'm not sure if those are an issue with BN or the morphology. I noticed that if the 'Interact with Sections' option is used, the lines dissapear.

image

@Helveg
Copy link
Contributor Author

Helveg commented Jan 14, 2021

Great news! Thanks for the workaround, I can continue playing around now!

@JustasB JustasB changed the title Trying to import cell groups errors in Blender 2.79b Handle long cell/section names Jan 20, 2021
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

No branches or pull requests

2 participants