Prabhu Ramachandran | 17 Apr 21:41 2014
Picon

Mayavi and VTK 6.x

Hi all,

Thanks to a lot of effort from Deepak Surti, we have a working version 
of Mayavi with VTK-6.x.

There were a few upstream bugs in VTK which have been fixed. The latest 
version of VTK master should work although VTK-6.1 + the following 
patches is well tested to work:

http://review.source.kitware.com/#/c/15095/1
http://review.source.kitware.com/#/c/15138/

One of these is not merged yet but should be merged soon. With these, 
all the TVTK and mayavi tests pass.  There are 2 of the integration 
tests that fail but everything else passes. All the examples have also 
been tested and seem to run fine. This is the first phase of the 
migration to the new pipeline and once this is merged, we will work on 
the next set of changes to move to the new pipeline.  Note, that VTK 
5.10.1 continues to work fine as before and will continue to do so. 
Travis-ci continues to build only with 5.x and not with 6.x.

Over the next few weeks, as time permits, we will try to make some more 
changes.  This mostly has to do with using the new pipeline better.  We 
will also refactor some of the changes to be a little cleaner.

Enjoy!

cheers,
Prabhu

(Continue reading)

Florian M. Wagner | 16 Apr 11:57 2014
Picon

Interactive Slicer for 3D unstructured grid

Dear all,

as a quick inspection of simulation results I would like to add a Python function that takes a VTK file (3D tetrahedral grid with cell data) and opens a mayavi window with an interactive slicer. Is that technically possible and could you point me in the right direction? For the time being my code only visualizes the gridpoints:

def showMesh3D(mesh, interactive=True):
    """
    Proof of concept for mayavi binding.
    """

    # should avoid opening of mayavi window when building documentation
    if not interactive:
        mlab.options.offscreen = True

    fig = mlab.figure(bgcolor=(1, 1, 1), size=(400, 400))

    # temporary VTK write & read, may be replaced with direct VTK object.
    tmp = "/tmp/3d_view_%s.vtk" % os.getpid()
    mesh.exportVTK(tmp)
    src = mlab.pipeline.open(tmp, figure=fig)
    os.remove(tmp)

    surf = mlab.pipeline.surface(src, figure=fig, opacity=0.5)
    edges = mlab.pipeline.extract_edges(surf, figure=fig)
    mlab.pipeline.surface(edges, color=(0, 0, 0), figure=fig)
    #mlab.pipeline.image_plane_widget(surf, colormap='gray',
                                     #plane_orientation='x_axes')

Thanks a lot,
Florian
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users
Benjamin Hervy | 12 Mar 22:07 2014
Picon

Using UDP API and camera in Mayavi

Hello,

I'm facing some issues with Mayavi (great soft BTW) and especially when handling camera through udp api.

Here is my use case:
I have a python script to display a graph. Once the graph is drawn, I use serve_udp() method to wait for commands over udp protocol.
I want to send commands like camera.zoom(), camera.roll().

For example, when I want to zoom on a particular node in the graph, I retrieve x,y,z coordinates of the node and send
sock.sendto('camera.view(focalpoint=(str(x)+','+str(y)+','+str(z)+'))', '', 9008) ) to focus on the particular 3D point in the scene.

Where view() function is defined based on the doc : http://docs.enthought.com/mayavi/mayavi/auto/mlab_camera.html

Mayavi tells me that « exceptions.AttributeError: 'OpenGLCamera' object has no attribute 'view' »


But passing the same command inside the drawing script (using from mayavi.tools import camera) works well.
So I guessed that the two camera classes are not the same.

I've then tried to read doc related to OpenGLcamera such as here : http://www.vtk.org/Wiki/VTK/Examples/Python/Camera

But passing 'camera.SetFocalPoint(x,y,z)' through udp protocol raises the same error : exceptions.AttributeError: 'OpenGLCamera' object has no attribute 'SetFocalPoint'

Only camera.zoom(), camera.roll() seem to work.
Where am I wrong ? Is there a list of available methods to be used this way ?

Many thanks in advance.

Greetings,
BH
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users
Indranil Sinharoy | 7 Mar 17:21 2014
Picon

How to join/connect/group multiple objects in Mayavi?

Hi,

I would like to combine multiple Mayavi objects (which shows up as multiple 
data sources in the pipeline view) into a single "grouped" object so that I 
control all of their properties together. How can I do this?

A more detailed description of the question with the exact problem I am trying 
to solve (with code and pictures) is posted in stackoverflow 
(http://stackoverflow.com/questions/22241499/how-to-join-connect-group-
multiple-objects-in-mayavi2)

Thank you very much,
Indranil.

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
Thomas Vanneste | 13 Jan 09:56 2014
Picon

How to do Delaunay Triangulation with xz data instead of xy data

Hi everyone,

I am trying to plot some experimental data and I am facing a problem 
with the triangulation due to the y coordinates .. I figure out that the 
solution might be to change the grid from a xy to a xz one and use the y 
as the elevation. When I do that, the triangulation works perfects, but 
obviously the plot is rotated.

So is there a way to do so, maybe by using some masks or some filters to 
just invert the y and z columns for the triangulation?

Here is a basic code:

     import numpy
     from mayavi import mlab

     X2 = numpy.array([0, 0, 1, 1])
     Y2 = numpy.array([0.5, 0.45, 1, 0.5])
     Z2 = numpy.array([0, 1, 0.5,0])

     fig = mlab.figure(1, bgcolor=(1, 1, 1), fgcolor=(0.5, 0.5, 0.5))
     # Define the points in 3D space
     # including color code based on Z coordinate.
     pts = mlab.points3d(X2, Y2, Z2, Y2, colormap='jet')
     # Triangulate based on X, Y with Delaunay 2D algorithm.
     # Save resulting triangulation.
     mesh = mlab.pipeline.delaunay2d(pts)
     # Remove the point representation from the plot
     pts.remove()
     # Draw a surface based on the triangulation
     surf = mlab.pipeline.surface(mesh, colormap='jet')

     # Simple plot.
     mlab.outline(extent=(0,1,0,1,0,1))
     mlab.axes(extent=(0,1,0,1,0,1))
     mlab.show()

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
Jason Moore | 18 Dec 23:31 2013
Picon

Dark background for wx in Ubuntu

I've installed pyqt to get better visuals, but it would be nice if this wasn't the default when you install mayavi from Ubuntu's package managers on the latest version of Ubuntu.

Jason
moorepants.info
+01 530-601-9791
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users
Jason Moore | 16 Dec 22:36 2013
Picon

Fwd: How to transform and rotate parametric surfaces?

Sorry, default isn't to reply all on this list.

Jason
moorepants.info
+01 530-601-9791


---------- Forwarded message ----------
From: Jason Moore <moorepants <at> gmail.com>
Date: Mon, Dec 16, 2013 at 4:34 PM
Subject: Re: [MayaVi-users] How to transform and rotate parametric surfaces?
To: Roan LaPlante <aestrivex <at> gmail.com>


I just want a quick way to draw primitives (tori, spheres, cones, cylinders) in a scene with particular dimensions and be able to rotate and translate them with respect to other objects I've created with mlab.mesh.

Ideally I'd like something like:

torus = mlab.Torus()
torus.center = [2., 3., 4.]
torus.orientation = [[0.1, 0.1, 0],
                            [0.2, 0.3, 0],
                            [0, 0, 1]]
torus.ring_radius = 5.0
torus.cross_section_radius = 0.2
mlab.show()

Does the tvtk or mayavi api offer anything like this?




On Mon, Dec 16, 2013 at 4:21 PM, Roan LaPlante <aestrivex <at> gmail.com> wrote:
Hi Jason,


What are you trying to do?  In general, mayavi does not have universal and easily manipulable concepts of what space its visualizations occupy.  Rather, sources occupy some space, and different sources vary extensively in how easily they are manipulated (mostly because they are not very featureful sources in vtk, and all mayavi does is wrap the vtk source).

However, in general if you're unsatisfied with the API that mayavi provides you to work with your visualizations, its almost always possible to hack these further and effectively do some vtk programming.  For instance, if you wanted to displace this torus in the x,y,z plane, you could edit the s.children[0].children[0].actor.actor.origin trait.


R


On Mon, Dec 16, 2013 at 3:19 PM, Jason Moore <moorepants <at> gmail.com> wrote:
I've created torus like so:

from mayavi import mlab
s = mlab.pipeline.parametric_surface()
s.function = 'torus'

And can change it's geometry like:

s.parametric_function.ring_radius = 10.0

But how do I transform and locate the object in the main coordinate system? I can't seem to figure this out...

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users




------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users
Jason Moore | 16 Dec 21:19 2013
Picon

How to transform and rotate parametric surfaces?

I've created torus like so:

from mayavi import mlab
s = mlab.pipeline.parametric_surface()
s.function = 'torus'

And can change it's geometry like:

s.parametric_function.ring_radius = 10.0

But how do I transform and locate the object in the main coordinate system? I can't seem to figure this out...

Jason
moorepants.info
+01 530-601-9791
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users
André | 24 Oct 17:34 2013
Picon

List and question,

Hi Mayavi-World.

Guys first of all I would like to know if this list is still alive for the current Myavi version. 
Mine :
Mayavi version 4.3.0 - VTK version 5.10.1
Python 2.7.5 
wxPython 2.8.12.0

There is so few activity here and it's in sourceforge while the current code is in GitHub that I am wondering if there is another list. 

Well no more questions about the list, I have a problem with volume visualization.

I'm struggling to use mlab.pipeline.volume() as an animation. So far I saw all the test_[].py examples search for hours over google and stackexchange not sucess. 
So here I come, I want to see a pressure field 3D progressing over time.
I have tried the following and many variants with mlab.pipeline.image_plane_widget no sucess.

I would like to do something like this:
from mayavi import mlab import numpy fig = mlab.gcf() u = numpy.random.rand(30,30,30) sscalar = mlab.pipeline.scalar_field(u) min = u.min(); max = u.max() min = min+0.65*(max-min); max = min+0.9*(max-min) svolume = mlab.pipeline.volume(sscalar, vmin=min, vmax=max) for i in range(20): u = numpy.random.rand(30,30,30) min = u.min(); max = u.max() min = min+0.65*(max-min); max = min+0.9*(max-min) svolume.mlab_source.set(scalar = u, vmin=min, vmax=max)
Is the code above right? The code above just freezes my Mayavi interface (run script) or python or ipython. I can just see the first plot nothing after that coz it gets
stucked.

Thanks a lot for any advice,

Cheers,

André


--
Bem, faça sua escolha. As torturas ocorrem. Se elas são desnecessária, então não há nenhum Deus, tampouco um Deus mau. Se há um Deus bom, então torturas são necessárias. Pois nenhum Ser que fosse bom, mesmo de maneira comedida provavelmente não seria capaz de as infringir ou de as permitir caso elas não fossem necessárias. C. S. Lewis - A Grief Observed
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users
Travis Hoppe | 27 Sep 16:50 2013
Picon

How do I adjust the slice_index of a cut plane in Mayavi?

Given that I've created a scalar field via:

SF  = mlab.pipeline.scalar_field(H)
obj = mlab.pipeline.image_plane_widget(SF,
               plane_orientation='y_axes',
               slice_index=16)

How do I adjust the slice_index on the mlab.pipeline.image_plane_widget 
for animation purposes, i.e. not with the GUI? Want I'm looking for is a 
simple animation of the cut plane sweeping across an axis, is there a 
example of this somewhere?

Thanks!

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
Shane Carey | 5 Sep 22:52 2013
Picon

3-d vertical raster


Hi,

I have 3-d point data (a vertical fault dataset) and I need to create a 3-d continuous surface of the data. Its an x,y,z data set where x,y,z are vector arrrays.

Im new to mayavi and python so I was any advice on how to go about this would be great. Mayavi is the best way to go about visualizing the data.

I can plot the data in 3-d, but cannot create a continous surface of the data. Here is my code for plotting the data points in 3-d

from enthought.mayavi import mlab
import numpy as np

x, y, z = np.loadtxt("E:/3_D/fault_5t.txt").T
pts=mlab.points3d(x, y, z,scale)

mlab.show()

Thanks in advance

--
Shane
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Gmane