Page 1 of 1

Disable NEURON GUI

Posted: Thu Apr 13, 2017 10:52 am
by viniciuslima
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.

Re: Disable NEURON GUI

Posted: Thu Apr 13, 2017 3:39 pm
by ted
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?

Re: Disable NEURON GUI

Posted: Fri Apr 21, 2017 1:00 pm
by viniciuslima
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')


Re: Disable NEURON GUI

Posted: Fri Apr 21, 2017 5:14 pm
by ted
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")