29 class SubLevelSetTree;
90 std::vector<double> &barycenter)
const {
91 for(
unsigned int k = 0; k < 3; ++k)
96 for(
unsigned int k = 0; k < 3; ++k)
100 inline void getSample(
const int &
id, std::vector<int> &sample)
const {
120 void smooth(
const std::vector<Node> &nodeList,
121 const std::vector<std::vector<double>> *vertexPositions,
125 const std::vector<int> *vertexOffsets,
126 const std::vector<Node> *nodeList,
155 if((neighborId < 0) || (neighborId >= (
int)
downArcList_.size()))
167 if((neighborId < 0) || (neighborId >= (
int)
upArcList_.size()))
206 if((arcId < 0) || (arcId >= (
int)
upArcList_.size()))
232 const int &upVertexId,
233 const std::vector<int> &interiorNodeIds)
244 const int &upVertexId,
245 const std::vector<int> &interiorNodeIds)
override;
258 const bool &isSubLevelSet =
true);
264 int clearArc(
const int &vertexId0,
const int &vertexId1);
271 =
"output.plot")
const;
274 =
"output.plot")
const;
277 const double &scaleX = 1,
278 const double &scaleY = 1);
283 const std::vector<float> *origin =
nullptr,
284 const std::vector<float> *voxelSize =
nullptr);
289#ifndef TTK_ENABLE_KAMIKAZE
290 if((arcId < 0) || (arcId >= (
int)
arcList_.size()))
291 this->
printErr(
"Out-of-bounds access in getArc: element "
292 + std::to_string(arcId) +
" in list of size "
306#ifndef TTK_ENABLE_KAMIKAZE
307 if((nodeId < 0) || (nodeId >= (
int)
nodeList_.size()))
308 this->
printErr(
"Out-of-bounds access in getNode: element "
309 + std::to_string(nodeId) +
" in list of size "
316 const int &neighborId)
const {
317#ifndef TTK_ENABLE_KAMIKAZE
319 this->
printErr(
"Nullptr dereference in getNodeDownNeighbor");
325 const int &neighborId)
const {
326#ifndef TTK_ENABLE_KAMIKAZE
327 if((nodeId < 0) || (nodeId >= (
int)
nodeList_.size()))
328 this->
printErr(
"Out-of-bounds access in getNodeDownNeighbor: element "
329 + std::to_string(nodeId) +
" in list of size "
337 const int &neighborId)
const {
338#ifndef TTK_ENABLE_KAMIKAZE
340 this->
printErr(
"Nullptr dereference in getNodeUpNeighbor");
346 const int &neighborId)
const {
347#ifndef TTK_ENABLE_KAMIKAZE
348 if((nodeId < 0) || (nodeId >= (
int)
nodeList_.size()))
349 this->
printErr(
"Out-of-bounds access in getNodeUpNeighbor: element "
350 + std::to_string(nodeId) +
" in list of size "
360 if((nodeId < 0) || (nodeId >= (
int)
nodeList_.size()))
378 std::vector<std::pair<double, double>> &diagram,
379 std::vector<std::pair<std::pair<int, int>,
double>> *pairs
388 std::vector<std::pair<std::pair<int, int>,
double>> &pairs,
389 std::vector<std::pair<std::pair<int, int>,
double>> *mergePairs =
nullptr,
390 std::vector<std::pair<std::pair<int, int>,
double>> *splitPairs
394 std::vector<std::pair<double, int>> &plot,
395 std::vector<std::pair<std::pair<int, int>,
double>> *persistencePairs
399#ifndef TTK_ENABLE_KAMIKAZE
400 if((superArcId < 0) || (superArcId >= (
int)
superArcList_.size()))
401 this->
printErr(
"Out-of-bounds access in getSuperArc: element "
402 + std::to_string(superArcId) +
" in list of size "
410#ifndef TTK_ENABLE_KAMIKAZE
417 scalar = (*vertexScalars_)[vertexId];
423#ifndef TTK_ENABLE_KAMIKAZE
425 this->
printErr(
"Out-of-bounds access in getVertexSuperArc: element "
426 + std::to_string(vertexId) +
" in list of size "
429 this->
printErr(
"Invalid super arc id for vertex "
430 + std::to_string(vertexId));
437#ifndef TTK_ENABLE_KAMIKAZE
439 this->
printErr(
"Out-of-bounds access in getVertexSuperArcId: element "
440 + std::to_string(vertexId) +
" in list of size "
447#ifndef TTK_ENABLE_KAMIKAZE
449 this->
printErr(
"Out-of-bounds access in getVertexNode: element "
450 + std::to_string(vertexId) +
" in list of size "
453 this->
printErr(
"Invalid node id value in getVertexNode at index"
454 + std::to_string(vertexId));
475 bool isSosLowerThan(
const int &vertexId0,
const int &vertexId1)
const;
477 bool isSosHigherThan(
const int &vertexId0,
const int &vertexId1)
const;
521 if((!i) || (
minScalar_ > (*vertexScalars_)[i])) {
524 if((!i) || (
maxScalar_ < (*vertexScalars_)[i])) {
535 virtual int simplify(
const double &simplificationThreshold,
538 int sample(
unsigned int samplingLevel = 3);
542 const std::vector<double> &scalars,
543 std::vector<std::vector<double>> &skeletonScalars)
const;
557 std::vector<int> &vertexIds,
558 const std::vector<float> *origin,
559 const std::vector<float> *voxelSize,
564 std::vector<int> &vertexIds,
565 const std::vector<float> *origin,
566 const std::vector<float> *voxelSize,
569 int makeArc(
const int &nodeId0,
const int &nodeId1);
602 std::vector<std::pair<std::pair<int, int>,
double>> &pairs,
603 std::vector<std::pair<std::pair<int, int>,
double>> *mergePairs =
nullptr,
604 std::vector<std::pair<std::pair<int, int>,
double>> *splitPairs
605 =
nullptr)
const override;
608 std::vector<std::pair<double, int>> &plot,
609 std::vector<std::pair<std::pair<int, int>,
double>> *mergePairs =
nullptr,
610 std::vector<std::pair<std::pair<int, int>,
double>> *splitPairs =
nullptr,
611 std::vector<std::pair<std::pair<int, int>,
double>> *pairs
615 std::vector<std::pair<double, double>> &diagram,
616 std::vector<std::pair<std::pair<int, int>,
double>> *mergePairs =
nullptr,
617 std::vector<std::pair<std::pair<int, int>,
double>> *splitPairs =
nullptr,
618 std::vector<std::pair<std::pair<int, int>,
double>> *pairs
635 const std::vector<int> &neighborList);
641 int simplify(
const double &simplificationThreshold,
AbstractTriangulation is an interface class that defines an interface for efficient traversal methods...
void setDownNodeId(const int &downNodeId)
void setUpNodeId(const int &upNodeId)
int getDownNodeId() const
virtual double computeSuperArcMetric(const int &downVertexId, const int &upVertexId, const std::vector< int > &interiorNodeIds)=0
TTK processing package that computes the contour tree of scalar data and more (data segmentation,...
int getPersistenceDiagram(std::vector< std::pair< double, double > > &diagram, std::vector< std::pair< std::pair< int, int >, double > > *mergePairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *splitPairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *pairs=nullptr) const
int setVertexNeighbors(const std::vector< std::vector< int > > *vertexNeighbors)
int setVertexNeighbors(const int &vertexId, const std::vector< int > &neighborList)
int computeSkeleton(unsigned int arcResolution=3) override
int simplify(const double &simplificationThreshold, ContourTreeSimplificationMetric *metric=nullptr) override
int smoothSkeleton(unsigned int skeletonSmoothing) override
const SubLevelSetTree * getMergeTree() const
int maintainRegularVertices(const bool &onOff) override
int getPersistencePlot(std::vector< std::pair< double, int > > &plot, std::vector< std::pair< std::pair< int, int >, double > > *mergePairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *splitPairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *pairs=nullptr) const
bool isNodeEligible(const Node *n) const
SubLevelSetTree mergeTree_
int finalizeSuperArc(const int &nodeId, const int &arcId)
SubLevelSetTree splitTree_
int clearSkeleton() override
const SubLevelSetTree * getSplitTree() const
int getPersistencePairs(std::vector< std::pair< std::pair< int, int >, double > > &pairs, std::vector< std::pair< std::pair< int, int >, double > > *mergePairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *splitPairs=nullptr) const override
Minimalist debugging class.
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
std::vector< int > downArcList_
int getUpArcId(const int &neighborId) const
std::vector< int > upSuperArcList_
void addDownSuperArcId(const int &downSuperArcId)
int removeDownArcId(const int &arcId)
int getNumberOfUpArcs() const
int getUpSuperArcId(const int &neighborId) const
int getDownArcId(const int &neighborId) const
std::vector< int > downSuperArcList_
int getNumberOfDownArcs() const
void addUpSuperArcId(const int &upSuperArcId)
void setVertexId(const int &vertexId)
int getNumberOfDownSuperArcs() const
void addDownArcId(const int &downArcId)
int removeUpArcId(const int &arcId)
int getNumberOfUpSuperArcs() const
std::vector< int > upArcList_
void addUpArcId(const int &upArcId)
int getDownSuperArcId(const int &neighborId) const
double computeSuperArcMetric(const int &downVertexId, const int &upVertexId, const std::vector< int > &interiorNodeIds) override
int clearRoot(const int &vertexId)
int exportPersistenceDiagram(const std::string &fileName="output.plot") const
bool isSosHigherThan(const int &vertexId0, const int &vertexId1) const
int getSkeletonScalars(const std::vector< double > &scalars, std::vector< std::vector< double > > &skeletonScalars) const
void setTriangulation(const AbstractTriangulation *const triangulation)
int moveRegularNode(const Node *n, const Node *oldDown, const Node *oldUp, const Node *newDown, const Node *newUp)
void setMaximumList(std::vector< int > &maximumList)
const std::vector< int > * getExtremumList() const
void setNumberOfVertices(const int &vertexNumber)
std::vector< Node > originalNodeList_
int exportToSvg(const std::string &fileName, const double &scaleX=1, const double &scaleY=1)
int getVertexSuperArcId(const int &vertexId) const
std::vector< int > * minimumList_
int clearRegularNode(const int &vertexId)
int appendRegularNode(const int &superArcId, const int &nodeId)
void setMinimumList(std::vector< int > &minimumList)
int getPersistenceDiagram(std::vector< std::pair< double, double > > &diagram, std::vector< std::pair< std::pair< int, int >, double > > *pairs=nullptr) const
const Node * getNode(const int &nodeId) const
int exportPersistenceCurve(const std::string &fileName="output.plot") const
virtual int clearSkeleton()
void setVertexScalars(const std::vector< real > *const vertexScalars)
const AbstractTriangulation * triangulation_
virtual int computeSkeleton(unsigned int arcResolution=3)
int buildSaddleList(std::vector< int > &vertexList) const
bool maintainRegularVertices_
std::vector< int > vertex2superArcNode_
std::vector< int > * vertexSoSoffsets_
void setVertexPositions(std::vector< std::vector< double > > *vertexPositions)
std::vector< Arc > arcList_
std::vector< SuperArc > superArcList_
std::vector< SuperArc > originalSuperArcList_
int getNumberOfArcs() const
const Node * getVertexNode(const int &vertexId) const
int getNumberOfNodes() const
int getVertexNodeId(const int &vertexId) const
double getNodeScalar(const int &nodeId) const
std::vector< int > * maximumList_
std::vector< Node > nodeList_
int getNumberOfSuperArcs() const
int exportArcPosToVtk(const int &arcId, const int &pointId, std::vector< int > &vertexIds, const std::vector< float > *origin, const std::vector< float > *voxelSize, std::ofstream &o)
int makeNode(const int &vertexId)
virtual int maintainRegularVertices(const bool &onOff)
std::vector< int > vertex2node_
const SuperArc * getSuperArc(const int &superArcId) const
std::vector< std::vector< double > > * vertexPositions_
int sample(unsigned int samplingLevel=3)
int exportNodePosToVtk(const int &nodeId, const int &pointId, std::vector< int > &vertexIds, const std::vector< float > *origin, const std::vector< float > *voxelSize, std::ofstream &o)
int makeArc(const int &nodeId0, const int &nodeId1)
virtual int getPersistencePairs(std::vector< std::pair< std::pair< int, int >, double > > &pairs, std::vector< std::pair< std::pair< int, int >, double > > *mergePairs=nullptr, std::vector< std::pair< std::pair< int, int >, double > > *splitPairs=nullptr) const
int buildExtremumList(std::vector< int > &extremumList, const bool &isSubLevelSet=true)
const SuperArc * getVertexSuperArc(const int &vertexId) const
virtual int simplify(const double &simplificationThreshold, ContourTreeSimplificationMetric *metric=nullptr)
int openSuperArc(const int &nodeId)
const Node * getNodeUpNeighbor(const int &nodeId, const int &neighborId) const
int exportToVtk(const std::string &fileName, const std::vector< float > *origin=nullptr, const std::vector< float > *voxelSize=nullptr)
int getPersistencePlot(std::vector< std::pair< double, int > > &plot, std::vector< std::pair< std::pair< int, int >, double > > *persistencePairs=nullptr) const
void setVertexSoSoffsets(std::vector< int > *vertexSoSoffsets)
const Node * getNodeDownNeighbor(const Node *n, const int &neighborId) const
const Node * getNodeUpNeighbor(const Node *n, const int &neighborId) const
int exportNodeColorToVtk(const int &nodeId, std::ofstream &o)
std::vector< int > vertex2superArc_
int getVertexScalar(const int &vertexId, double &scalar)
int closeSuperArc(const int &superArcId, const int &nodeId)
bool isSosLowerThan(const int &vertexId0, const int &vertexId1) const
bool buildPlanarLayout(const double &scaleX, const double &scaleY)
const Node * getNodeDownNeighbor(const int &nodeId, const int &neighborId) const
const std::vector< real > * vertexScalars_
virtual int smoothSkeleton(unsigned int skeletonSmoothing)
int clearArc(const int &vertexId0, const int &vertexId1)
const Arc * getArc(const int &arcId) const
int getNumberOfRegularNodes() const
void getBarycenter(const int &id, double barycenter[3]) const
void appendSample(const std::vector< int > &sample)
int getNumberOfBarycenters() const
void getSample(const int &id, std::vector< int > &sample) const
int getRegularNodeId(const int &arcNodeId) const
std::vector< std::vector< double > > barycenterList_
void appendBarycenter(const std::vector< double > &barycenter)
void smooth(const std::vector< Node > &nodeList, const std::vector< std::vector< double > > *vertexPositions, bool order=true)
std::vector< int > regularNodeList_
std::vector< std::vector< int > > sampleList_
void getBarycenter(const int &id, std::vector< double > &barycenter) const
void sortRegularNodes(const std::vector< double > *vertexScalars, const std::vector< int > *vertexOffsets, const std::vector< Node > *nodeList, bool order=true)
int getNumberOfSamples() const
void appendRegularNode(const int &nodeId)