TTK
|
TTK topologicalCompression processing package. More...
#include <TopologicalCompression.h>
Public Member Functions | |
TopologicalCompression () | |
template<class dataType , typename triangulationType = AbstractTriangulation> | |
int | execute (const dataType *const inputData, const SimplexId *const inputOffsets, dataType *outputData, const triangulationType &triangulation) |
template<class dataType , typename triangulationType > | |
int | computePersistencePairs (std::vector< std::tuple< SimplexId, SimplexId, dataType > > &JTPairs, std::vector< std::tuple< SimplexId, SimplexId, dataType > > &STPairs, const dataType *const inputScalars_, const SimplexId *const inputOffsets, const triangulationType &triangulation) |
template<typename dataType , typename triangulationType > | |
int | compressForPersistenceDiagram (int vertexNumber, const dataType *const inputData, const SimplexId *const inputOffset, dataType *outputData, const double &tol, const triangulationType &triangulation) |
int | computeOther () const |
template<typename dataType > | |
int | compressForOther (int vertexNumber, const dataType *const inputData, const SimplexId *const inputOffsets, dataType *outputData, const double &tol) const |
void | setCompressionType (int compressionType) |
void | setSQ (const std::string &sqMethod) |
void | setZFPOnly (bool z) |
void | setSubdivide (bool b) |
void | setMaximumError (double maximumError) |
void | setTolerance (const double data) |
void | setUseTopologicalSimplification (bool useTopologicalSimplification) |
void | setFileName (char *fn) |
void | preconditionTriangulation (AbstractTriangulation *const triangulation) |
int | getNbVertices () const |
int | getNbSegments () const |
std::vector< int > & | getSegmentation () |
std::vector< std::tuple< double, int > > & | getMapping () |
std::vector< std::tuple< int, double, int > > & | getCriticalConstraints () |
int | getCompressionType () const |
int | getSQMethod () const |
int | getDataScalarType () const |
int * | getDataExtent () |
double * | getDataSpacing () |
double * | getDataOrigin () |
double | getTolerance () const |
double | getZFPTolerance () const |
void | relToAbsZFPTolerance (const double zfpRelTol, const std::array< double, 2 > &sfRange) |
Switch from a relative (% of scalar field range) to an absolute ZFP tolerance. | |
bool | getZFPOnly () const |
const std::vector< char > & | getDataArrayName () const |
std::vector< double > & | getDecompressedData () |
std::vector< SimplexId > & | getDecompressedOffsets () |
std::vector< SimplexId > & | getCompressedOffsets () |
template<typename T > | |
T | Read (FILE *fm) const |
template<typename T > | |
void | ReadByteArray (FILE *fm, T *buffer, size_t length) const |
template<typename T > | |
void | Write (FILE *fm, T data) const |
template<typename T > | |
void | WriteByteArray (FILE *fm, const T *buffer, size_t length) const |
int | ReadCompactSegmentation (FILE *fm, std::vector< int > &segmentation, int &numberOfVertices, int &numberOfSegments) const |
int | ReadPersistenceIndex (FILE *fm, std::vector< std::tuple< double, int > > &mappings, std::vector< std::tuple< double, int > > &mappingsSortedPerValue, std::vector< std::tuple< int, double, int > > &constraints, double &min, double &max, int &nbConstraints) const |
int | ReadMetaData (FILE *fm) |
template<typename triangulationType > | |
int | ReadFromFile (FILE *fm, const triangulationType &triangulation) |
int | WriteCompactSegmentation (FILE *fm, const std::vector< int > &segmentation, int numberOfVertices, int numberOfSegments) const |
int | WritePersistenceIndex (FILE *fm, std::vector< std::tuple< double, int > > &mapping, std::vector< std::tuple< int, double, int > > &constraints) const |
int | WriteMetaData (FILE *fp, int compressionType, bool zfpOnly, const char *sqMethod, int dataType, int *dataExtent, double *dataSpacing, double *dataOrigin, double tolerance, double zfpTolerance, const std::string &dataArrayName) |
int | WriteToFile (FILE *fp, int compressionType, bool zfpOnly, const char *sqMethod, int dataType, int *dataExtent, double *dataSpacing, double *dataOrigin, double *data, double tolerance, double zfpTolerance, const std::string &dataArrayName) |
template<typename dataType > | |
void | CropIntervals (std::vector< std::tuple< dataType, int > > &mappings, std::vector< std::tuple< dataType, int > > &mappingsSortedPerValue, double min, double max, int vertexNumber, double *array, std::vector< int > &Seg) const |
template<typename dataType > | |
int | compressForOther (int ttkNotUsed(vertexNumber), const dataType *const ttkNotUsed(inputData), const SimplexId *const ttkNotUsed(inputOffsets), dataType *ttkNotUsed(outputData), const double &ttkNotUsed(tol)) const |
Public Member Functions inherited from ttk::Debug | |
Debug () | |
~Debug () override | |
virtual int | setDebugLevel (const int &debugLevel) |
int | setWrapper (const Wrapper *wrapper) override |
int | printMsg (const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsg (const std::vector< std::string > &msgs, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printErr (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const |
int | printWrn (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const |
int | printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const double &memory, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const double &progress, const double &time, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const double &progress, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const double &progress, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsg (const std::vector< std::vector< std::string > > &rows, const debug::Priority &priority=debug::Priority::INFO, const bool hasHeader=true, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsg (const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const |
int | printMsg (const debug::Separator &separator, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const |
void | setDebugMsgPrefix (const std::string &prefix) |
Public Member Functions inherited from ttk::BaseClass | |
BaseClass () | |
virtual | ~BaseClass ()=default |
int | getThreadNumber () const |
virtual int | setThreadNumber (const int threadNumber) |
Static Public Member Functions | |
static unsigned int | log2 (int val) |
static bool | cmp (const std::tuple< double, int > &a, const std::tuple< double, int > &b) |
static bool | cmp2 (const std::tuple< double, int > &a, const std::tuple< double, int > &b) |
Protected Attributes | |
LegacyTopologicalSimplification | topologicalSimplification {} |
ftm::FTMTreePP | ftmTreePP |
int | compressionType_ {} |
bool | ZFPOnly {false} |
double | ZFPTolerance {50} |
int | SQMethodInt {} |
double | Tolerance {10} |
double | MaximumError {10} |
int | CompressionType {static_cast<int>(CompressionType::PersistenceDiagram)} |
std::string | SQMethod {} |
bool | Subdivide {false} |
bool | UseTopologicalSimplification {true} |
int | dataScalarType_ {} |
int | dataExtent_ [6] |
double | dataSpacing_ [3] |
double | dataOrigin_ [3] |
std::vector< char > | dataArrayName_ {} |
std::vector< int > | segmentation_ {} |
std::vector< std::tuple< double, int > > | mapping_ {} |
std::vector< std::tuple< int, double, int > > | criticalConstraints_ {} |
int | NbVertices {0} |
int | NbSegments {0} |
int | rawFileLength {0} |
std::vector< double > | decompressedData_ {} |
std::vector< SimplexId > | decompressedOffsets_ {} |
std::vector< SimplexId > | compressedOffsets_ {} |
int | vertexNumberRead_ {} |
char * | fileName {} |
const char * | magicBytes_ {"TTKCompressedFileFormat"} |
const unsigned long | formatVersion_ {2} |
Protected Attributes inherited from ttk::Debug | |
int | debugLevel_ |
std::string | debugMsgPrefix_ |
std::string | debugMsgNamePrefix_ |
Protected Attributes inherited from ttk::BaseClass | |
bool | lastObject_ |
int | threadNumber_ |
Wrapper * | wrapper_ |
Additional Inherited Members | |
Protected Member Functions inherited from ttk::Debug | |
int | printMsgInternal (const std::string &msg, const std::string &right, const std::string &filler, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsgInternal (const std::string &msg, const debug::Priority &priority, const debug::LineMode &lineMode, std::ostream &stream=std::cout) const |
int | welcomeMsg (std::ostream &stream) |
Static Protected Attributes inherited from ttk::Debug | |
static COMMON_EXPORTS debug::LineMode | lastLineMode = ttk::debug::LineMode::NEW |
TTK topologicalCompression processing package.
TopologicalCompression is a TTK processing package that takes a scalar field on the input and produces a scalar field on the output.
Definition at line 30 of file TopologicalCompression.h.
ttk::TopologicalCompression::TopologicalCompression | ( | ) |
Definition at line 4 of file TopologicalCompression.cpp.
|
inlinestatic |
Definition at line 179 of file TopologicalCompression.h.
|
inlinestatic |
Definition at line 183 of file TopologicalCompression.h.
int ttk::TopologicalCompression::compressForOther | ( | int | ttkNotUsedvertexNumber, |
const dataType *const | ttkNotUsedinputData, | ||
const SimplexId *const | ttkNotUsedinputOffsets, | ||
dataType * | ttkNotUsedoutputData, | ||
const double & | ttkNotUsedtol | ||
) | const |
Definition at line 15 of file OtherCompression.h.
int ttk::TopologicalCompression::compressForOther | ( | int | vertexNumber, |
const dataType *const | inputData, | ||
const SimplexId *const | inputOffsets, | ||
dataType * | outputData, | ||
const double & | tol | ||
) | const |
int ttk::TopologicalCompression::compressForPersistenceDiagram | ( | int | vertexNumber, |
const dataType *const | inputData, | ||
const SimplexId *const | inputOffset, | ||
dataType * | outputData, | ||
const double & | tol, | ||
const triangulationType & | triangulation | ||
) |
Definition at line 279 of file PersistenceDiagramCompression.h.
int ttk::TopologicalCompression::computeOther | ( | ) | const |
Definition at line 575 of file TopologicalCompression.cpp.
int ttk::TopologicalCompression::computePersistencePairs | ( | std::vector< std::tuple< SimplexId, SimplexId, dataType > > & | JTPairs, |
std::vector< std::tuple< SimplexId, SimplexId, dataType > > & | STPairs, | ||
const dataType *const | inputScalars_, | ||
const SimplexId *const | inputOffsets, | ||
const triangulationType & | triangulation | ||
) |
Definition at line 253 of file PersistenceDiagramCompression.h.
void ttk::TopologicalCompression::CropIntervals | ( | std::vector< std::tuple< dataType, int > > & | mappings, |
std::vector< std::tuple< dataType, int > > & | mappingsSortedPerValue, | ||
double | min, | ||
double | max, | ||
int | vertexNumber, | ||
double * | array, | ||
std::vector< int > & | Seg | ||
) | const |
Definition at line 186 of file PersistenceDiagramCompression.h.
int ttk::TopologicalCompression::execute | ( | const dataType *const | inputData, |
const SimplexId *const | inputOffsets, | ||
dataType * | outputData, | ||
const triangulationType & | triangulation | ||
) |
inputOffsets
buffer prior to any computation (the VTK wrapper already includes a mechanism to automatically generate such a preconditioned buffer). Definition at line 413 of file TopologicalCompression.h.
|
inline |
Definition at line 173 of file TopologicalCompression.h.
|
inline |
Definition at line 128 of file TopologicalCompression.h.
|
inline |
Definition at line 124 of file TopologicalCompression.h.
|
inline |
Definition at line 164 of file TopologicalCompression.h.
|
inline |
Definition at line 137 of file TopologicalCompression.h.
|
inline |
Definition at line 143 of file TopologicalCompression.h.
|
inline |
Definition at line 134 of file TopologicalCompression.h.
|
inline |
Definition at line 140 of file TopologicalCompression.h.
|
inline |
Definition at line 167 of file TopologicalCompression.h.
|
inline |
Definition at line 170 of file TopologicalCompression.h.
|
inline |
Definition at line 121 of file TopologicalCompression.h.
|
inline |
Definition at line 115 of file TopologicalCompression.h.
|
inline |
Definition at line 112 of file TopologicalCompression.h.
|
inline |
Definition at line 118 of file TopologicalCompression.h.
|
inline |
Definition at line 131 of file TopologicalCompression.h.
|
inline |
Definition at line 146 of file TopologicalCompression.h.
|
inline |
Definition at line 160 of file TopologicalCompression.h.
|
inline |
Definition at line 149 of file TopologicalCompression.h.
|
static |
Definition at line 140 of file TopologicalCompression.cpp.
|
inline |
Definition at line 104 of file TopologicalCompression.h.
|
inline |
Definition at line 189 of file TopologicalCompression.h.
|
inline |
Definition at line 202 of file TopologicalCompression.h.
int ttk::TopologicalCompression::ReadCompactSegmentation | ( | FILE * | fm, |
std::vector< int > & | segmentation, | ||
int & | numberOfVertices, | ||
int & | numberOfSegments | ||
) | const |
Definition at line 155 of file TopologicalCompression.cpp.
int ttk::TopologicalCompression::ReadFromFile | ( | FILE * | fm, |
const triangulationType & | triangulation | ||
) |
Definition at line 443 of file TopologicalCompression.h.
int ttk::TopologicalCompression::ReadMetaData | ( | FILE * | fm | ) |
Definition at line 798 of file TopologicalCompression.cpp.
int ttk::TopologicalCompression::ReadPersistenceIndex | ( | FILE * | fm, |
std::vector< std::tuple< double, int > > & | mappings, | ||
std::vector< std::tuple< double, int > > & | mappingsSortedPerValue, | ||
std::vector< std::tuple< int, double, int > > & | constraints, | ||
double & | min, | ||
double & | max, | ||
int & | nbConstraints | ||
) | const |
Definition at line 342 of file TopologicalCompression.cpp.
|
inline |
Switch from a relative (% of scalar field range) to an absolute ZFP tolerance.
Definition at line 156 of file TopologicalCompression.h.
|
inline |
Definition at line 78 of file TopologicalCompression.h.
|
inline |
Definition at line 100 of file TopologicalCompression.h.
|
inline |
Definition at line 90 of file TopologicalCompression.h.
|
inline |
Definition at line 81 of file TopologicalCompression.h.
|
inline |
Definition at line 87 of file TopologicalCompression.h.
|
inline |
Definition at line 93 of file TopologicalCompression.h.
|
inline |
Definition at line 97 of file TopologicalCompression.h.
|
inline |
Definition at line 84 of file TopologicalCompression.h.
|
inline |
Definition at line 210 of file TopologicalCompression.h.
|
inline |
Definition at line 221 of file TopologicalCompression.h.
int ttk::TopologicalCompression::WriteCompactSegmentation | ( | FILE * | fm, |
const std::vector< int > & | segmentation, | ||
int | numberOfVertices, | ||
int | numberOfSegments | ||
) | const |
Definition at line 259 of file TopologicalCompression.cpp.
int ttk::TopologicalCompression::WriteMetaData | ( | FILE * | fp, |
int | compressionType, | ||
bool | zfpOnly, | ||
const char * | sqMethod, | ||
int | dataType, | ||
int * | dataExtent, | ||
double * | dataSpacing, | ||
double * | dataOrigin, | ||
double | tolerance, | ||
double | zfpTolerance, | ||
const std::string & | dataArrayName | ||
) |
Definition at line 733 of file TopologicalCompression.cpp.
int ttk::TopologicalCompression::WritePersistenceIndex | ( | FILE * | fm, |
std::vector< std::tuple< double, int > > & | mapping, | ||
std::vector< std::tuple< int, double, int > > & | constraints | ||
) | const |
Definition at line 409 of file TopologicalCompression.cpp.
int ttk::TopologicalCompression::WriteToFile | ( | FILE * | fp, |
int | compressionType, | ||
bool | zfpOnly, | ||
const char * | sqMethod, | ||
int | dataType, | ||
int * | dataExtent, | ||
double * | dataSpacing, | ||
double * | dataOrigin, | ||
double * | data, | ||
double | tolerance, | ||
double | zfpTolerance, | ||
const std::string & | dataArrayName | ||
) |
Definition at line 610 of file TopologicalCompression.cpp.
|
protected |
Definition at line 396 of file TopologicalCompression.h.
|
protected |
Definition at line 373 of file TopologicalCompression.h.
|
protected |
Definition at line 366 of file TopologicalCompression.h.
|
protected |
Definition at line 388 of file TopologicalCompression.h.
|
protected |
Definition at line 383 of file TopologicalCompression.h.
|
protected |
Definition at line 379 of file TopologicalCompression.h.
|
protected |
Definition at line 381 of file TopologicalCompression.h.
|
protected |
Definition at line 378 of file TopologicalCompression.h.
|
protected |
Definition at line 380 of file TopologicalCompression.h.
|
protected |
Definition at line 394 of file TopologicalCompression.h.
|
protected |
Definition at line 395 of file TopologicalCompression.h.
|
protected |
Definition at line 398 of file TopologicalCompression.h.
|
protected |
Definition at line 404 of file TopologicalCompression.h.
|
protected |
Definition at line 363 of file TopologicalCompression.h.
|
protected |
Definition at line 401 of file TopologicalCompression.h.
|
protected |
Definition at line 387 of file TopologicalCompression.h.
|
protected |
Definition at line 372 of file TopologicalCompression.h.
|
protected |
Definition at line 392 of file TopologicalCompression.h.
|
protected |
Definition at line 391 of file TopologicalCompression.h.
|
protected |
Definition at line 393 of file TopologicalCompression.h.
|
protected |
Definition at line 386 of file TopologicalCompression.h.
|
protected |
Definition at line 374 of file TopologicalCompression.h.
|
protected |
Definition at line 369 of file TopologicalCompression.h.
|
protected |
Definition at line 375 of file TopologicalCompression.h.
|
protected |
Definition at line 371 of file TopologicalCompression.h.
|
protected |
Definition at line 362 of file TopologicalCompression.h.
|
protected |
Definition at line 376 of file TopologicalCompression.h.
|
protected |
Definition at line 397 of file TopologicalCompression.h.
|
protected |
Definition at line 367 of file TopologicalCompression.h.
|
protected |
Definition at line 368 of file TopologicalCompression.h.