How to use the mayavi.mlab.show function in mayavi

To help you get started, we’ve selected a few mayavi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enthought / mayavi / integrationtests / mayavi / test_mlab_show.py View on Github external
def test_mlab_show():
    """Test mlab.show()"""
    run_mlab_examples()
    # Automatically close window in 100 msecs.
    GUI.invoke_after(100, close)
    mlab.show()
github RivuletStudio / rivuletpy / rivuletpy / soma.py View on Github external
fig = mlab.gcf()
    mlab.clf()
    src = mlab.pipeline.scalar_field(msnake.data)
    mlab.pipeline.image_plane_widget(
        src, plane_orientation='x_axes', colormap='gray')
    cnt = mlab.contour3d(msnake.levelset, contours=[0.5])

    @mlab.animate(ui=True)
    def anim():
        for i in range(num_iters):
            msnake.step()
            cnt.mlab_source.scalars = msnake.levelset
            yield

    anim()
    mlab.show()

    # Return the last levelset.
    return msnake.levelset
github Lujano / PointCloudLM-Software / Integracion / PointClouds / Python_Code / Visualizacion.py View on Github external
def viewer_pointcloud(pointcloud):
    mlab.figure(bgcolor=(1, 1, 1))
    mlab.points3d(pointcloud[:, 0], pointcloud[:, 1], pointcloud[:, 2], color=(0, 0, 0), mode='point')
    mlab.show()
    return
github Lujano / PointCloudLM-Software / PointCloud / Codigo / 3DPlot_Rango.py View on Github external
def viewer_pointcloud(pointcloud):
    mlab.figure(bgcolor=(1, 1, 1))
    mlab.points3d(pointcloud[:, 0], pointcloud[:, 1], pointcloud[:, 2], color=(0, 1, 0), mode='sphere', scale_factor = 0.025)
    mlab.show()
    return
github rpmuller / pyquante2 / pyquante2 / graphics / maya.py View on Github external
xmin,xmax,ymin,ymax,zmin,zmax = mol.bbox()
    x, y, z = np.mgrid[xmin:xmax:(npts*1j),ymin:ymax:(npts*1j),zmin:zmax:(npts*1j)]

    fxyz = np.zeros((npts, npts, npts))
    for c,bf in zip(orb,bfs):
        fxyz += c*bf(x, y, z)

    src = mlab.pipeline.scalar_field(x, y, z, fxyz)
    mlab.pipeline.iso_surface(src, contours=[-posval,posval], opacity=0.6)
    for d,ind in planes:
        if not ind: ind = npts//2
        mlab.pipeline.image_plane_widget(src,
                                         plane_orientation='%s_axes' % d,
                                         slice_index=ind)
        
    if doshow: mlab.show()
    return
github notmatthancock / pylidc / pylidc / Annotation.py View on Github external
ax.set_ylim(0, ceil)
            ax.set_ylabel('length (mm)')

            ax.set_zlim(0, ceil)
            ax.set_zlabel('length (mm)')

            plt.tight_layout()
            plt.show()
        elif backend == 'mayavi':
            try:
                from mayavi import mlab
                sf = mlab.pipeline.scalar_field(mask.astype(np.float))
                sf.spacing = [rij, rij, rk]
                mlab.pipeline.iso_surface(sf, contours=[0.5])
                mlab.show()
            except ImportError:
                print("Mayavi could not be imported. Is it installed?")
github charlesq34 / frustum-pointnets / kitti / kitti_object.py View on Github external
draw_lidar(pc_velo, fig=fig)

    for obj in objects:
        if obj.type=='DontCare':continue
        # Draw 3d bounding box
        box3d_pts_2d, box3d_pts_3d = utils.compute_box_3d(obj, calib.P) 
        box3d_pts_3d_velo = calib.project_rect_to_velo(box3d_pts_3d)
        # Draw heading arrow
        ori3d_pts_2d, ori3d_pts_3d = utils.compute_orientation_3d(obj, calib.P)
        ori3d_pts_3d_velo = calib.project_rect_to_velo(ori3d_pts_3d)
        x1,y1,z1 = ori3d_pts_3d_velo[0,:]
        x2,y2,z2 = ori3d_pts_3d_velo[1,:]
        draw_gt_boxes3d([box3d_pts_3d_velo], fig=fig)
        mlab.plot3d([x1, x2], [y1, y2], [z1,z2], color=(0.5,0.5,0.5),
            tube_radius=None, line_width=1, figure=fig)
    mlab.show(1)
github charlesq34 / frustum-pointnets / kitti / prepare_data.py View on Github external
fgcolor=None, engine=None, size=(1000, 500))
    draw_lidar(backprojected_pc_velo, fig=fig)
    raw_input()

    # Only display those points that fall into 2d box
    print(' -------- LiDAR points in a frustum from a 2D box --------')
    xmin,ymin,xmax,ymax = \
        objects[0].xmin, objects[0].ymin, objects[0].xmax, objects[0].ymax
    boxfov_pc_velo = \
        get_lidar_in_image_fov(pc_velo, calib, xmin, ymin, xmax, ymax)
    print('2d box FOV point num: ', boxfov_pc_velo.shape[0])

    fig = mlab.figure(figure=None, bgcolor=(0,0,0),
        fgcolor=None, engine=None, size=(1000, 500))
    draw_lidar(boxfov_pc_velo, fig=fig)
    mlab.show(1)
    raw_input()
github Lujano / PointCloudLM-Software / PointCloud / Codigo / 3DPlot_Rango.py View on Github external
def viewer_original_vs_ransac_pointcloud_vs_plane(ransac_pcl, original_pcl, plane_model):
    sensor_range = 120.0
    mlab.figure(bgcolor=(1, 1, 1))
    x, y = np.ogrid[-sensor_range+50:sensor_range+50:1, -sensor_range:sensor_range:1]
    mlab.points3d(original_pcl[:, 0], original_pcl[:, 1], original_pcl[:, 2], color=(0, 0, 0), mode='point')
    mlab.points3d(ransac_pcl[:, 0], ransac_pcl[:, 1], ransac_pcl[:, 2], color=(1, 0, 0), mode='point')
    mlab.surf(x, y, (-plane_model[3] - (plane_model[0]*x) - (plane_model[1]*y)) / plane_model[2],
              color=(0.8, 0.8, 1), opacity=0.3)
    mlab.show()
    return
github jackd / template_ffd / paper / big_table.py View on Github external
all_ds[example_id]
            plt.imshow(image)
            mlab.figure()
            vis_mesh(gt_mesh, color=(0, 0, 1))
            mlab.figure()
            vis_mesh(mesh, color=(0, 1, 0))
            mlab.figure()
            vis_mesh(template_mesh, color=(1, 0, 0))
            mlab.figure()
            vis_point_cloud(
                np.array(cloud), scale_factor=0.01, color=(0, 1, 0))
            mlab.figure()
            vis_voxels(voxels.data, color=(0, 1, 0))

            plt.show(block=False)
            mlab.show()
            plt.close()