Re: neuronvisio and passing height, width to class Visualization(HasTraits)

Skip to first unread message

Michele Mattioni

May 9, 2012, 6:36:48 AM5/9/12
to Espen Hagen, neuronvisio
Hi Espen,

I just extend your mail to ML, so also other people can jump in and
gets logged for future references.

On Wed, May 9, 2012 at 10:43 AM, Espen Hagen <> wrote:
> Hello Michele,
> First, let me thank you for the excellent neuronvisio-tool. I use the
> Visio() class in it to generate visualizations of membrane voltages in
> populations of active cells in conjugation with LFPy
> (

that's awesome. I need to give it a go :D.
Are you using Visio as a library?

> However, I have some problem with how class Visualization hard-code the
> window size, and could not figure out a way to pass arguments height and
> width through Visio() -> MayaviQWidget() -> Visualization in any way, as
> putting a Visualtization._init_ procedure setting these do not work, as it
> does not seem to have the desired effect.

Well right now the height of the scene is hardcoded because we fired
up the widnow, and the user was able to resize it with the mouse at
will. It is possible to change that, we just need to understand what
is the most clean way to do it.

> I can change the size of the window object afterwards through commands, but
> that doesn't affect the scaling of the window content, like you would if you
> use the mouse to change the size for example.
> Do you know how this can be solved, that would be very helpful indeed.

Can you provide a self-example of what you want to do and then we can
see how we can approach this?
Or the way you use Visio so we could figure out the best way to do it?

Maybe the best is to open an Issue on github and then hopefully a
pull-request :)


Michele Mattioni

May 11, 2012, 11:19:07 AM5/11/12
to Espen Hagen, neuronvisio
Hi Epsen,

On Fri, May 11, 2012 at 2:23 PM, Espen Hagen <> wrote:
> Hi again, Michele
> [cut]
> Yes, I only had to rewrite the class quite a bit though, as I don't use
> the p3d-information from NEURON, and use the endpoint coordinates of the
> segments which I collect in the LFPy.Cell-class, where also the
> 3d-positions of the different neurons, corresponding rotations etc are
> set. I also had to add some stuff to be able to feed numpy arrays
> containing the time-variable values from each segment, say the membrane
> voltage.

Maybe I don't get this. Neuronvisio job is exactly this one:
visualizing in 3d the NEURON model, and being able to show the
variables (recorded through a VecRef) with a color coded scale.
Maybe there is a ton of extra information that is in the
LFpy.Cell-Class, which it's specific to your user cases, otherwise you
could just use the class visio to show that.

> I'm not suggesting in any way that my changes should be in neuronvisio,
> what I did probably broke the old functionality completely. A big hack
> basically, but very useful for me to understand a bit on what's going on
> with all that mayavi.pipeline stuff. I do like what I end up with though,
> as in the attached plot with my cells and some electrode geometry of which
> I calculate the LFPs.
> What could be useful however would be a class method somewhere in class
> Visio taking some input;
>>>> def setWindowHeighWidth(self, height=500, width=600):
>>>>     '''set the window height and width and scale the scene contents
>        accordingly'''
>>>>     ...
> I could not find the proper way to do this though. I don't think your
> method was ever meant to be called by the user in the way I do, so this is
> perhaps not something you should worry about.

if you fire it up visio, mayavi widget is embedded in a Qt container,
which you could resize

controls.visio.container.resize(500, 600)


Reply all
Reply to author
0 new messages