Search found 23 matches

by JustasB
Wed Jun 12, 2019 8:43 pm
Forum: NEURON + Python
Topic: Guidance on plotting cell's geometry in Python?
Replies: 4
Views: 6368

Re: Guidance on plotting cell's geometry in Python?

For anyone else who has a similar need to visualize cell model shape beyond what is available in NEURON, I've made tools that I used for such purpose available online. Consider the following options: Use a tool like hoc2swc to convert your cell model to the SWC morphology format. Then you can use an...
by JustasB
Fri Jun 07, 2019 11:19 am
Forum: Anatomically detailed models
Topic: converting hoc to swc
Replies: 7
Views: 5436

Re: converting hoc to swc

If it's useful to anyone else, I packaged the code that exports NEURON cells to SWC files into a pip-install'able Python package: hoc2swc.

Description and instructions can be found here: https://github.com/JustasB/hoc2swc
by JustasB
Sat Mar 23, 2019 2:31 pm
Forum: Suggestions and Feedback
Topic: Possible off-by-one bug in ModelView > Export to NeuroML
Replies: 9
Views: 956

Re: Possible off-by-one bug in ModelView > Export to NeuroML

Interesting. So it looks like the "orphan root" s2d section was what caused the original problem to appear. The s2d might be safe to remove -- it's only referenced in the create statements, and I found no references to it elsewhere in the project. As you mentioned, it's not connected to anything els...
by JustasB
Thu Mar 21, 2019 11:36 pm
Forum: Suggestions and Feedback
Topic: Possible off-by-one bug in ModelView > Export to NeuroML
Replies: 9
Views: 956

Re: Possible off-by-one bug in ModelView > Export to NeuroML

I noticed another, very similar parent-id-off-by-one issue with another model but now in a single cell instantiation scenario. The underlying cause might be the same. Steps to reproduce: Use this HOC file: https://senselab.med.yale.edu/ModelDB/showmodel.cshtml?model=114665&file=/plast/gc-plast.hoc#t...
by JustasB
Thu Mar 21, 2019 5:53 pm
Forum: Suggestions and Feedback
Topic: Possible off-by-one bug in ModelView > Export to NeuroML
Replies: 9
Views: 956

Re: Possible off-by-one bug in ModelView > Export to NeuroML

I get the same "parent id off-by-one" issue when instantiating multiple instances of a cell made using CellBuilder. Here is the HOC template (soma + a spiraling dendrite): https://pastebin.com/J64KfDmZ Then I instantiate it twice with: h.load_file('TestCell.hoc') c1 = h.TestCell() c2 = h.TestCell() ...
by JustasB
Thu Mar 21, 2019 4:10 pm
Forum: Suggestions and Feedback
Topic: Possible off-by-one bug in ModelView > Export to NeuroML
Replies: 9
Views: 956

Re: Possible off-by-one bug in ModelView > Export to NeuroML

Ah, that's an interesting case. I did notice the two pieces in Shape plot, but I wasn't familiar enough with the model to tell if the oddity was intentional or not. I looked for the "multi-create" issue in the source code of the models that I have locally and was able to find a few other models wher...
by JustasB
Wed Mar 20, 2019 9:48 pm
Forum: Suggestions and Feedback
Topic: Possible off-by-one bug in ModelView > Export to NeuroML
Replies: 9
Views: 956

Possible off-by-one bug in ModelView > Export to NeuroML

I'm running into an issue where when I try to export a model to NeuroML, it generates an XML file that refers to an incorrect parent segment (parent id is off-by-one). Below are the steps to reproduce the issue: # Download a model from ModelDB: https://github.com/ModelDBRepository/116094/archive/mas...
by JustasB
Wed Mar 20, 2019 9:15 pm
Forum: Suggestions and Feedback
Topic: StackOverflow-like site for NEURON?
Replies: 1
Views: 13875

Re: StackOverflow-like site for NEURON?

Having gone through the process of proposing the new Stack Exchange site, the main lesson I learned is that proposals for new Stack Exchange sites are more suitable for large communities with high volumes of questions. In general, the broader the topic of a proposed Stack Exchange site, the more lik...
by JustasB
Fri Apr 06, 2018 8:09 pm
Forum: NEURON + Python
Topic: Cannot get Vector.play() and NetCon/NetStim work with CVODE and SaveState.restore()
Replies: 4
Views: 1594

Re: Cannot get Vector.play() and NetCon/NetStim work with CVODE and SaveState.restore()

Strangely, writing a post here has made it easier to solve my own problem! The problem appears to be with the NetStim.start time, before the restore, being set to 0. If I set the NetStim.start equal to the h.t value after the restore, the crash dissapears. So I believe I've found a workaround. It is...
by JustasB
Fri Apr 06, 2018 7:41 pm
Forum: NEURON + Python
Topic: Cannot get Vector.play() and NetCon/NetStim work with CVODE and SaveState.restore()
Replies: 4
Views: 1594

Cannot get Vector.play() and NetCon/NetStim work with CVODE and SaveState.restore()

I am having trouble using Vector.play() and NetCon/NetStim together with CVODE and SaveState.restore(). I run the simulation until my model reaches steady state, then I save with SaveState.save(), and then I inject an arbitrary current into the cell after SaveState.restore(). A NetCon/NetStim combin...
by JustasB
Mon Mar 05, 2018 5:00 pm
Forum: Other questions
Topic: Two issues with cvode.event when using cvode.active(1)
Replies: 7
Views: 1561

Re: Two issues with cvode.event when using cvode.active(1)

so it has NOT YET been documented in the Programmer's Reference! even though it appears in several blocks of example code in the Programmer's Reference!! Haha. Understood. Thank you for the explanation. I will make sure I use cvode_active() whenever I use cvode. Just an update, the problematic mode...
by JustasB
Mon Mar 05, 2018 3:40 pm
Forum: Other questions
Topic: Two issues with cvode.event when using cvode.active(1)
Replies: 7
Views: 1561

Re: Two issues with cvode.event when using cvode.active(1)

Hmmm I had tried cvode_active() in the original code, but without the test section it still produced the same error. However, test section + cvode_active(1) both issues disappear. Thank you for the suggestion. I will try it in my full script. In the hot tip about using cvode_active() , you mention t...
by JustasB
Mon Mar 05, 2018 12:39 pm
Forum: Other questions
Topic: Two issues with cvode.event when using cvode.active(1)
Replies: 7
Views: 1561

Re: Two issues with cvode.event when using cvode.active(1)

Ok, when I add a section, Issue #2 dissapears, but Issue #1 (h.t >> h.tstop) remains (code below). However, the reason why I'm posting what appears to be a contrived example is because I'm experiencing an intermittent, hard-to-reproduce issue in a script that works with more complex model's I'm work...
by JustasB
Sun Mar 04, 2018 6:30 pm
Forum: Other questions
Topic: Two issues with cvode.event when using cvode.active(1)
Replies: 7
Views: 1561

Two issues with cvode.event when using cvode.active(1)

I'm running into issues where h.t runs past h.tstop and cvode.events are triggered too early while using cvode. I've managed to reproduce the issues with this snippet: Using NEURON 7.5 master (6b4c19f) on Windows (same issue on NRN 7.4 on Ubuntu 16.04), paste the following in python console: from ne...