psection-like dump of global parameters
psection-like dump of global parameters
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.
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.
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
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).
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).
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.
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.
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Excellent!patoorio wrote:I dug into mview.hoc and all the hoc files it called
I don't see that print is a public member of anything in nrn/lib/hoc/mviewand 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?
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.
To excute a method of an object you need a reference to the object.It doesn't even work if I wrote modelview.text()
In your case you can probably use
Code: Select all
ModelView[0].text()
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.
Well, it was kind of easy.
Modified the mview1.hoc file:
- Added textp to one of the public statements
- Inserted the following code:
Then, I have to type (or insert in the hoc file):
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).
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()
}
Code: Select all
load_file("mview.hoc")
mview()
ModelView[0].textp("filename.ext")
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).
To open a ModelView without a gui use
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
Code: Select all
load_file("mview.hoc")
objref m
m = new ModelView(0)
m.textp("filename.ext")
use
Code: Select all
m.destroy()
objref m
ModelView[0].gui.b.unmap
Re: psection-like dump of global parameters
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?
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: psection-like dump of global parameters
Presumably the subsets are implemented as SectionLists, in which case
forsec sectionlistname print secname()
should work.
forsec sectionlistname print secname()
should work.