Page 1 of 1
psection-like dump of global parameters
Posted: Wed Jun 04, 2008 10:36 am
by patoorio
Hi,
Is there a way to dump the global parameters for all the inserted mechanisms and processes? psection() only dumps the RANGE parameters (otherwise it wouldn't be called psection() ).
Moreover, I would like to produce such dump without having to know a priori which mechanisms/processes are inserted.
Thanks.
Posted: Thu Jun 05, 2008 10:21 am
by ted
forall
statement
will execute
statement in the context of each section, one at a time.
However, psection() is not the best tool for dissecting the properties of a model. For one
thing, it cannot tell you anything about inhomogeneity of a range variable along the length of
a section.
Model View is probably the best tool for discovering the properties of models of individual
neurons. See "ModelView: Compact display of parameters for NEURON models" on the
Documentation page
http://www.neuron.yale.edu/neuron/docs
In addition to giving you a browsable outline, it can write a summary of these properties to
a text or XML file (click on its File button, then select which kind of output you want).
Posted: Thu Jun 05, 2008 11:49 am
by patoorio
Thanks Ted for your answer.
ModelView does exactly what I want. Well, it probably does much more than what I need -but I can handle that.
Now my problem is that I want to do it programatically (i.e., write a hoc code that will generate a text file with all the info that Model View gives).
I dug into mview.hoc and all the hoc files it called, and found that I need to call modelview.text(). But I can't! It doesn't even work if I wrote modelview.text() in the terminal window, with the Model View GUI open. What am I missing here?
Regards.
Posted: Thu Jun 05, 2008 12:17 pm
by ted
patoorio wrote:I dug into mview.hoc and all the hoc files it called
Excellent!
and found that I need to call modelview.text(). But I can't! It doesn't even work if I wrote modelview.text() in the terminal window, with the Model View GUI open. What am I missing here?
I don't see that print is a public member of anything in nrn/lib/hoc/mview
Even if it was, it would probably bring up a "directory browser/file selector" GUI tool that
asks you to enter the name of the file to be printed.
Posted: Thu Jun 05, 2008 3:39 pm
by hines
It doesn't even work if I wrote modelview.text()
To excute a method of an object you need a reference to the object.
In your case you can probably use
However that will pop up a file chooser first.
I should modify the method so that if it is called with a filename arg
it prints to the file without any further user interaction. Til then feel free to
modify the nrn/lib/hoc/mview/mview1.hoc:proc text() method or add a
similar one to the file and make it public.
Posted: Fri Jun 06, 2008 11:33 am
by patoorio
Well, it was kind of easy.
Modified the mview1.hoc file:
- Added
textp to one of the
public statements
- Inserted the following code:
Code: Select all
proc textp() {local i localobj file
file = new File()
file.wopen($s1)
for i=0, display.top.count-1 {
textout(file, display.top.object(i))
}
file.close()
}
Then, I have to type (or insert in the hoc file):
Code: Select all
load_file("mview.hoc")
mview()
ModelView[0].textp("filename.ext")
But now I want to know: How do I programatically close the Model View window? I couldn't find the appropriate command.
And probably more important: If the ModelView is closed and opened again during the same neuron session, it will be no longer ModelView[0] but ModelView[1] (or [2], or [3]...). How can I deal with that? In other words, is there a way to unambiguously call the last ModelView instance? (I guess this will apply to every time one wants to call the last instance of any object).
Posted: Sun Jun 08, 2008 8:54 am
by hines
To open a ModelView without a gui use
Code: Select all
load_file("mview.hoc")
objref m
m = new ModelView(0)
m.textp("filename.ext")
ModelView is the center of a constellation of mutually referencing objects so to destroy
use
But to answer your question as to how to close a ModelView window, use
ModelView[0].gui.b.unmap
Posted: Mon Jun 09, 2008 9:29 am
by patoorio
Excellent!!
Thanks a lot.
Re: psection-like dump of global parameters
Posted: Thu Jul 17, 2014 12:09 am
by Tom Close
Thanks Patoorio, Ted, Michael, this method works nicely. However, is there a straightforward way to extend it to also print out the names of the secctions in each of the the ModelViewParmSubsets?
Re: psection-like dump of global parameters
Posted: Thu Jul 17, 2014 3:16 pm
by ted
Presumably the subsets are implemented as SectionLists, in which case
forsec sectionlistname print secname()
should work.