Disable NEURON GUI

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
viniciuslima
Posts: 7
Joined: Wed Mar 29, 2017 9:01 pm

Disable NEURON GUI

Post by viniciuslima » Thu Apr 13, 2017 10:52 am

I'm trying to not call the NEURON GUI in my simulation, but even if i don't import GUI (from neuron import gui) the window shows up.
I tried to run as python code_name.py -nogui and it has no effect either.

ted
Site Admin
Posts: 5136
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Disable NEURON GUI

Post by ted » Thu Apr 13, 2017 3:39 pm

What window are you referring to? The NEURON Main Menu toolbar, or something else (what something else?)? If it's just NEURON Main Menu, look for a statement that loads nrngui.hoc, and if you find it, comment it out and insert a statement that loads stdgui.hoc (yes I know that name sounds like something you don't want, but trust me, it won't create and of NEURON's GUI windows).

If you're executing somebody else's code, are you sure it doesn't contain some statement(s) that create one of NEURON's gui windows?

viniciuslima
Posts: 7
Joined: Wed Mar 29, 2017 9:01 pm

Re: Disable NEURON GUI

Post by viniciuslima » Fri Apr 21, 2017 1:00 pm

Hi Ted,

Yes im referring to the NEURON Main Menu. I'm using the following code:

Code: Select all


import numpy
from matplotlib.pyplot import *
from neuron import h
from destexheCell import *

h.dt = 0.05
npoints = 5000

tstop = npoints * h.dt
h.runStopAt = tstop
h.steps_per_ms = 1/h.dt
h.celsius = 36
h.v_init = -70

cell = destexheCell()

fl = h.Gfluct2(cell.soma(0.5))
fl.std_e = 0.012
fl.std_i = 0.0264

v_vec = h.Vector()
t_vec = h.Vector()
v_vec.record(cell.soma(0.5)._ref_v)
t_vec.record(h._ref_t)


h.tstop = tstop
h.run()


savdata = h.File()
savdata.wopen('m_pot_python.dat')
for i in range(0, len(v_vec)):
        savdata.printf("%f\n", v_vec[i])

plot(t_vec, v_vec, color = 'black')
xlabel('Tempo [ms]')
ylabel('Potencial de Membrana')


ted
Site Admin
Posts: 5136
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Disable NEURON GUI

Post by ted » Fri Apr 21, 2017 5:14 pm

If you are starting NEURON from the command line, try calling nrniv instead of nrngui.
If that doesn't work, or if you are starting python and then importing neuron, check all of the code in your program and make sure that you change any statement that looks like
load_file("nrngui.hoc")
or
h.load_file("nrngui.hoc")
to
load_file("stdgui.hoc")
or
h.load_file("stdgui.hoc")

Post Reply