BlenderNEURON icon indicating copy to clipboard operation
BlenderNEURON copied to clipboard

Handle long cell/section names

Open Helveg opened this issue 4 years ago • 4 comments

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 avatar Jan 13 '21 17:01 Helveg

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

Helveg avatar Jan 13 '21 17:01 Helveg

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 avatar Jan 14 '21 14:01 JustasB

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

JustasB avatar Jan 14 '21 14:01 JustasB

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

Helveg avatar Jan 14 '21 14:01 Helveg