TTK
Loading...
Searching...
No Matches
Functions
ttkPersistenceDiagramUtils.h File Reference
#include <Debug.h>
#include <PersistenceDiagramUtils.h>
#include <ttkPersistenceDiagramModule.h>

Go to the source code of this file.

Functions

TTKPERSISTENCEDIAGRAM_EXPORT int VTUToDiagram (ttk::DiagramType &diagram, vtkUnstructuredGrid *vtu, const ttk::Debug &dbg)
 Converts a Persistence Diagram in the VTK Unstructured Grid format (as generated by the ttkPersistenceDiagram module) to the ttk::DiagramType format.
 
TTKPERSISTENCEDIAGRAM_EXPORT int DiagramToVTU (vtkUnstructuredGrid *vtu, const ttk::DiagramType &diagram, vtkDataArray *const inputScalars, const ttk::Debug &dbg, const int dim, const bool embedInDomain)
 Converts a Persistence Diagram in the ttk::DiagramType format to the VTK Unstructured Grid format (as generated by the ttkPersistenceDiagram module).
 
TTKPERSISTENCEDIAGRAM_EXPORT int ProjectDiagramInsideDomain (vtkUnstructuredGrid *const inputDiagram, vtkUnstructuredGrid *const outputDiagram, const ttk::Debug &dbg)
 Generate the spatial embedding of a given Persistence Diagram.
 
TTKPERSISTENCEDIAGRAM_EXPORT int ProjectDiagramIn2D (vtkUnstructuredGrid *const inputDiagram, vtkUnstructuredGrid *const outputDiagram, const ttk::Debug &dbg)
 Generate the 2D embedding of a given Persistence Diagram.
 
TTKPERSISTENCEDIAGRAM_EXPORT int TranslateDiagram (vtkUnstructuredGrid *const diagram, const std::array< double, 3 > &trans)
 Translate a diagram to a new position.
 
TTKPERSISTENCEDIAGRAM_EXPORT int ResetDiagramPosition (vtkUnstructuredGrid *const diagram, const ttk::Debug &dbg)
 Translate back a canonical diagram into its original position.
 

Function Documentation

◆ DiagramToVTU()

TTKPERSISTENCEDIAGRAM_EXPORT int DiagramToVTU ( vtkUnstructuredGrid *  vtu,
const ttk::DiagramType diagram,
vtkDataArray *const  inputScalars,
const ttk::Debug dbg,
const int  dim,
const bool  embedInDomain 
)

Converts a Persistence Diagram in the ttk::DiagramType format to the VTK Unstructured Grid format (as generated by the ttkPersistenceDiagram module).

Parameters
[out]vtuOutput VTK Unstructured Grid
[in]diagramVector of persistence pairs
[in]inputScalarsvtkDataArray pointer to input scalar field
[in]dbgReference to a ttk::Debug instance (for error messages)
[in]dimData-set dimensionality (to convert pair dimension to pair type)
[in]embedInDomainSwitch between the canonical and the embedded representation
Returns
0 in case of success, negative number otherwise

Definition at line 156 of file ttkPersistenceDiagramUtils.cpp.

◆ ProjectDiagramIn2D()

TTKPERSISTENCEDIAGRAM_EXPORT int ProjectDiagramIn2D ( vtkUnstructuredGrid *const  inputDiagram,
vtkUnstructuredGrid *const  outputDiagram,
const ttk::Debug dbg 
)

Generate the 2D embedding of a given Persistence Diagram.

Use the cellData arrays Birth and Death to project the Diagram

Parameters
[in]inputDiagramInput diagram in its spatial embedding form
[out]outputDiagramProjected diagram in its canonical form
[in]dbgDebug instance (for logging and access to threadNumber_)
Returns
0 in case of success

Definition at line 375 of file ttkPersistenceDiagramUtils.cpp.

◆ ProjectDiagramInsideDomain()

TTKPERSISTENCEDIAGRAM_EXPORT int ProjectDiagramInsideDomain ( vtkUnstructuredGrid *const  inputDiagram,
vtkUnstructuredGrid *const  outputDiagram,
const ttk::Debug dbg 
)

Generate the spatial embedding of a given Persistence Diagram.

Use the pointData array Coordinates to project the Diagram

Parameters
[in]inputDiagramInput diagram in its canonical form
[out]outputDiagramProjected diagram inside the input domain
[in]dbgDebug instance (for logging and access to threadNumber_)
Returns
0 in case of success

Definition at line 302 of file ttkPersistenceDiagramUtils.cpp.

◆ ResetDiagramPosition()

TTKPERSISTENCEDIAGRAM_EXPORT int ResetDiagramPosition ( vtkUnstructuredGrid *const  diagram,
const ttk::Debug dbg 
)

Translate back a canonical diagram into its original position.

Use the cellData array Birth as original coordinates

Parameters
[in,out]diagramInput diagram in its spatial embedding form
[in]dbgDebug instance (for logging and access to threadNumber_)
Returns
0 in case of success

Definition at line 467 of file ttkPersistenceDiagramUtils.cpp.

◆ TranslateDiagram()

TTKPERSISTENCEDIAGRAM_EXPORT int TranslateDiagram ( vtkUnstructuredGrid *const  diagram,
const std::array< double, 3 > &  trans 
)

Translate a diagram to a new position.

Parameters
[in,out]diagramInput diagram in its spatial embedding form
[in]transTranslation vector
Returns
0 in case of success

Definition at line 448 of file ttkPersistenceDiagramUtils.cpp.

◆ VTUToDiagram()

TTKPERSISTENCEDIAGRAM_EXPORT int VTUToDiagram ( ttk::DiagramType diagram,
vtkUnstructuredGrid *  vtu,
const ttk::Debug dbg 
)

Converts a Persistence Diagram in the VTK Unstructured Grid format (as generated by the ttkPersistenceDiagram module) to the ttk::DiagramType format.

Parameters
[out]diagramVector to be filled with persistence pairs
[in]vtuInput VTK Unstructured Grid
[in]dbgReference to a ttk::Debug instance (for error messages)
Returns
0 in case of success, negative number otherwise

Definition at line 16 of file ttkPersistenceDiagramUtils.cpp.