mattions / neuronvisio

A Graphical User Interface with 3D Visualization features for NEURON simulation enviroment
https://neuronvisio.readthedocs.io
Other
30 stars 15 forks source link

Saving the pyramidal model gives this error. When plotted has a diam... #18

Open mattions opened 14 years ago

mattions commented 14 years ago
In [2]: NEURON: lambda_f error: 0 diameter for 3d point 0 of soma.
 near line 0
 {forall SectionList[9].append()}
                                 ^
        execerror("lambda_f error:", "0 diameter for 3d point 0 of soma.")
      ModelViewSeclistAnalysis[0].lambda_f(100)
    ModelViewSeclistAnalysis[0].mk_nseg()
  ModelViewSeclistAnalysis[0].mkdisplay(TreeViewItem[5])
and others
oc_restore_code tobj_count=1 should be 0
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (29, 0))

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)

/home/mattions/Work/model/MSN/Neuronvisio/src/neuronvisio/controls.pyc in save_hdf(self)
    148             self.path_to_hdf = str(filename) # It will go with python 3
    149             if self.path_to_hdf != None:
--> 150                 self.manager.save_to_hdf(self.path_to_hdf)
    151                 msg = "Saved hdf file: %s" % self.path_to_hdf
    152                 self.ui.statusbar.showMessage(msg, 3500)

/home/mattions/Work/model/MSN/Neuronvisio/src/neuronvisio/manager.pyc in save_to_hdf(self, filename)
    299 
    300         # Saving the vecRef

--> 301         self._save_geom(h5f)
    302         res = h5f.createGroup('/', self.results_root)
    303         for group in self.refs:

/home/mattions/Work/model/MSN/Neuronvisio/src/neuronvisio/manager.pyc in _save_geom(self, h5file_holder)
    279 
    280         h.load_file('mview.hoc')
--> 281         modelView = h.ModelView(0)
    282         modelXml = h.ModelViewXML(modelView)
    283         tmp_file = 'temp.xml'

RuntimeError: hoc error
mattions commented 12 years ago

@pgleeson does NeuroMl (1.8) exporter accept diameter 0? Because I can't save the Pyramidal neuron that comes as an example, due to diameter 0 in the soma.

        execerror("lambda_f error:", "0 diameter for 3d point 0 of soma.")

I've checked soma has 0 ad diam in one point.

pgleeson commented 12 years ago

Believe this issue is nothing to do with NeuroML. It seems to be an internal check in Neuron before it gets to export the cell. Maybe throw up a dialog box when you get this error asking if the use wants to use 0.01 for zero diam segments, and insert this before exporting?

mattions commented 12 years ago

This is a bug in NEURON I guess.

I don't think changing the data would be a good idea, and I think we should report this.

consider this test

from neuron import h

for i in range(int(h.n3d())):
    msg = "Index %s, x3d: %s, y3d: %s, z3d: %s, diam3d: %s" %( i, 
                                                                h.x3d(i),
                                                                h.y3d(i),
                                                                h.z3d(i),
                                                                h.diam3d(i)
                                                                )
    print msg

this produces:

In [16]: run test_soma_diam3d.py
Index 0, x3d: -161.5, y3d: -17.0, z3d: -8.0, diam3d: 0.0
Index 1, x3d: -161.0, y3d: -18.375, z3d: -8.0, diam3d: 5.25
Index 2, x3d: -161.0, y3d: -19.375, z3d: -8.0, diam3d: 7.25
Index 3, x3d: -159.5, y3d: -18.25, z3d: -8.0, diam3d: 12.5
Index 4, x3d: -159.0, y3d: -18.2140007019, z3d: -8.0, diam3d: 13.5710000992
Index 5, x3d: -158.5, y3d: -19.1790008545, z3d: -8.0, diam3d: 16.642999649
Index 6, x3d: -156.0, y3d: -18.1669998169, z3d: -7.79169988632, diam3d: 20.3379993439
Index 7, x3d: -155.0, y3d: -17.5830001831, z3d: -7.70830011368, diam3d: 22.1739997864
Index 8, x3d: -152.5, y3d: -17.7220001221, z3d: -7.5, diam3d: 23.5769996643
Index 9, x3d: -150.5, y3d: -17.25, z3d: -7.5, diam3d: 23.5209999084
Index 10, x3d: -148.5, y3d: -16.7000007629, z3d: -8.0, diam3d: 21.6000003815
Index 11, x3d: -148.0, y3d: -16.611000061, z3d: -8.0, diam3d: 21.2220001221
Index 12, x3d: -146.5, y3d: -17.9440002441, z3d: -8.0, diam3d: 16.888999939
Index 13, x3d: -145.0, y3d: -19.5279998779, z3d: -8.0, diam3d: 12.0559997559
Index 14, x3d: -144.0, y3d: -20.5830001831, z3d: -8.0, diam3d: 8.83329963684
Index 15, x3d: -144.0, y3d: -19.3330001831, z3d: -8.0, diam3d: 6.33330011368
Index 16, x3d: -143.5, y3d: -17.5, z3d: -8.0, diam3d: 0.0

In index 0 and 16 the diam3d is reported to be 0, while the programmer reference state that diam3d should be always positive http://www.neuron.yale.edu/neuron/static/docs/help/neuron/neuron/geometry.html#diam3d

I guess this has to be flagged on the neuron forum and we will see from there