Skip to content

Persistent Generators Skull

Persistent Generators Skull example Image

Pipeline description

This example computes the infinitely persistent 1-cycles of the surface of the skull. These cycles smoothly capture the topological handles of the surface.

First the surface of the 3-dimensional triangulation is extracted. The surface generators are then extracted using the eigenfunctions of the Laplace-Beltrami operator. These eigenfunctions are computed with EigenField Generators are then computed on this smooth scalarfield using PersistentGenerators.

Finally, the cycles are smoothed along the original surface using SurfaceGeometrySmoother

The python script simply computes the cycles and saves the result as a .vtp file.

ParaView

To reproduce the above screenshot, go to your ttk-data directory and enter the following command:

paraview states/persistentGenerators_skull.pvsm

Python code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python

from paraview.simple import *

# create a new 'XML Unstructured Grid Reader'
skullvtu = XMLUnstructuredGridReader(FileName=["skull.vtu"])

# create a new 'Extract Surface'
extractSurface1 = ExtractSurface(Input=skullvtu)

# create a new 'TTK EigenField'
tTKEigenField1 = TTKEigenField(InputGeometry=extractSurface1)
tTKEigenField1.Numberofeigenfunctions = 50

# create a new 'Calculator'
calculator1 = Calculator(Input=tTKEigenField1)
calculator1.Function = '-"OutputEigenFunctions_22"'

# create a new 'TTK PersistentGenerators'
tTKPersistentGenerators1 = TTKPersistentGenerators(Input=calculator1)
tTKPersistentGenerators1.ScalarField = ["POINTS", "Result"]
tTKPersistentGenerators1.PruneHandlesGenerators = 1

SaveData("PersistentGeneratorsSkull.vtp", tTKPersistentGenerators1)

To run the above Python script, go to your ttk-data directory and enter the following command:

pvpython python/persistentGenerators_skull.py

Inputs

  • skull.vtu: A 3-dimensionnal triangulation of the skull dataset.

Outputs

  • PersistentGeneratorsSkull.vtp: the infinitely persistent 1-cycles of the surface.

C++/Python API

EigenField

PersistentGenerators

SurfaceGeometrySmoother