Mayavi scaling factor

Skip to first unread message

Uri Cohen

Jan 19, 2012, 5:16:21 PM1/19/12
On my Windows machine the 3D plot draw some invisible lines for some models.
The reason is that Mayavi is configured with absolute scaling and when the neuron's size spans several order of magnitude the small diameter compartments appear invisible. See the attached file for before (right) and after my solution (left).

The solution is just commenting "tube.filter.vary_radius = 'vary_radius_by_absolute_scalar'" in Does anyone aware of a reason not to do so? See this in Mayavi doc.
            Uri Cohen
mayavi scaling.PNG

Michele Mattioni

Jan 20, 2012, 5:43:42 AM1/20/12
Hi Uri,

this is a tricky one. As you said, the variance of models is very big,
therefore it's difficult to understand what is a sensible default.

If we use

tube.filter.vary_radius = 'vary_radius_by_absolute_scalar'

the lines are drawn, however they could be very thin and difficult to
see. However, as soon you zoom in, the result will be accurate and it
will reflect the dimension of the diameter (right figure).

On the other side, if we don't use this, mayavi will use a standard
diameter for all the lines. While this will seem more compelling at
first glance, when you zoom in, you will have a misguided
visualization of the neuron, because all the diameter will look the

More over, if the variance is very big, the current solution tend to
perform better than the one you proposing.
Have a look at my attachment with 'vary_radius_by_absolute_scalar' on,
current solution, and 'vary_radius_by_absolute_scalar' off, the one
you propose.

I think the current solution is the best of the two world, given the
fact to have thicker lines the user just need to zoom in.

My two cents,


Uri Cohen

Jan 20, 2012, 4:46:14 PM1/20/12
Hi Michele, your argument makes perfect sense for me and made me look further into my situation. So why didn't I just zoom-in? The short answer is that I didn't found the option...
Attached is how the Mayavi toolbar looks on my computer: no zoom-in.
What do I miss?
            Uri Cohen

Michele Mattioni

Jan 21, 2012, 9:57:13 AM1/21/12
the wheel!

Use the wheel of your mouse :D

Like google maps!

Reply all
Reply to author
0 new messages