How To Install python3-vtkplotter on Ubuntu 20.04

In this tutorial we learn how to install python3-vtkplotter on Ubuntu 20.04. python3-vtkplotter is python module for 3D scientific visualization with VTK

Introduction

In this tutorial we learn how to install python3-vtkplotter on Ubuntu 20.04.

What is python3-vtkplotter

python3-vtkplotter is:

A python module for scientific visualization, analysis and animation of 3D objects and point clouds based on VTK and numpy.

Intuitive and straightforward API which can be combined with VTK seamlessly in a program, whilst maintaining access to the full range of VTK native classes.

It includes a large set of working examples for the all following functionalities:

  • Import meshes from VTK format, STL, Wavefront OBJ, 3DS, XML, Neutral, GMSH, OFF, PCD (PointCloud), volumetric TIFF stacks, SLC, MHD, 2D images PNG, JPEG.
  • Export meshes as ASCII or binary to VTK, STL, OBJ, PLY formats.
  • Mesh analysis through the built-in methods of VTK package. Additional analysis tools like Moving Least Squares, mesh morphing.
  • Tools to visualize and edit meshes (cutting a mesh with another mesh, slicing, normalizing, moving vertex positions, etc..). Interactive cutter widget.
  • Split mesh based on surface connectivity. Extract the largest connected area.
  • Calculate mass properties, like area, volume, center of mass, average size etc.
  • Calculate vertex and face normals, curvatures, feature edges. Fill mesh holes.
  • Subdivide faces of a mesh, increasing the number of vertex points. Mesh simplification.
  • Coloring and thresholding of meshes based on associated scalar or vectorial data.
  • Point-surface operations: find nearest points, determine if a point lies inside or outside a mesh.
  • Create primitive objects like: spheres, arrows, cubes, torus, ellipsoids…
  • Generate glyphs (associating a mesh to each vertex of a source mesh).
  • Create animations easily by just defining the position of the displayed objects in the 3D scene. Add trailing lines to moving objects automatically.
  • Straightforward support for multiple sync-ed or independent renderers in the same window.
  • Registration (alignment) of meshes with different techniques.
  • Mesh smoothing with Laplacian and WindowedSinc algorithms.
  • Delaunay triangulation in 2D and 3D.
  • Generate meshes by joining nearby lines in space.
  • Find the closest path from one point to another, travelling along the edges of a mesh.
  • Find the intersection of a mesh with a line (or with another mesh).
  • Analysis of Point Clouds:
    • Moving Least Squares smoothing of 2D, 3D and 4D clouds
    • Fit lines, planes and spheres in space
    • Perform PCA (Principal Component Analysis) on point coordinates
    • Identify outliers in a distribution of points
    • Decimate a cloud to a uniform distribution.
  • Basic histogramming and function plotting in 1D and 2D.
  • Interpolate scalar and vectorial fields with Radial Basis Functions and Thin Plate Splines.
  • Analysis of volumetric datasets:
    • Isosurfacing of volumes
    • Direct maximum projection rendering
    • Generate volumetric signed-distance data from an input surface mesh
    • Probe a volume with lines and planes.
  • Add sliders and buttons to interact with the scene and the individual objects.
  • Examples using SHTools package for spherical harmonics expansion of a mesh shape.
  • Integration with the Qt5 framework.
  • Support for FEniCS/dolfin package.

vtkplotter is published in M. Musy et al. “vtkplotter, a python module for scientific visualization and analysis of 3D objects and point clouds based on VTK (Visualization Toolkit)”, Zenodo, 10 February 2019, doi:10.5281/zenodo.2561402.

This package installs the library for Python 3. It also include vtkplotter and vtkconvert executables.

There are three methods to install python3-vtkplotter on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python3-vtkplotter Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python3-vtkplotter using apt-get by running the following command:

sudo apt-get -y install python3-vtkplotter

Install python3-vtkplotter Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python3-vtkplotter using apt by running the following command:

sudo apt -y install python3-vtkplotter

Install python3-vtkplotter Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python3-vtkplotter using aptitude by running the following command:

sudo aptitude -y install python3-vtkplotter

How To Uninstall python3-vtkplotter on Ubuntu 20.04

To uninstall only the python3-vtkplotter package we can use the following command:

sudo apt-get remove python3-vtkplotter

Uninstall python3-vtkplotter And Its Dependencies

To uninstall python3-vtkplotter and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove python3-vtkplotter

Remove python3-vtkplotter Configurations and Data

To remove python3-vtkplotter configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge python3-vtkplotter

Remove python3-vtkplotter configuration, data, and all of its dependencies

We can use the following command to remove python3-vtkplotter configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python3-vtkplotter

References

Summary

In this tutorial we learn how to install python3-vtkplotter package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.