13#ifndef ML_VESSEL_EDGE_H
14#define ML_VESSEL_EDGE_H
38friend class LoadTreeData;
86 double distance(Vector3
vp)
const {
return getDistanceAndNearestSkeletonIndex(
vp).first; };
132 return createSkeleton(Vector3(
static_cast<MLdouble>(pos.x),
209 std::vector <Skeleton*> _skeletons;
235 void readOldGraphEdgeStateFromTree(TreeNode* parent);
237 void readOldVesselEdgeStateFromTree(TreeNode* parent);
Defines the basic Graph class which holds sets of nodes, edges and roots to model tubular structures ...
Skeleton objects represent centerline voxels stored in a VesselEdge object.
Skeleton * skeleton(Vector3 pos, int itemType)
Get the skeleton with minimal distance to pos.
Skeleton * skeleton(size_t index)
void readStateFromTree(TreeNode *parent) override
Reads the object state from the children of the given parent node.
void removeSkeleton(size_t index)
STATIC_GRAPH_PROPERTY(MLint, label, Label)
size_t getVoxelNum() const
Get number of edge voxels.
STATIC_GRAPH_PROPERTY(MLdouble, STLength, STLength)
STATIC_GRAPH_PROPERTY(MLdouble, STVolume, STVolume)
void removeTrailingSkeletons(size_t count)
void transform(const Matrix4 &m)
Apply a 4x4 homogeneous transformation matrix to all skeleton positions.
const VesselNode * predNode() const
void convertToVoxel(Matrix4 *mat)
Convert all skeleton coordinates.
bool markEdge(int a_label, float r, float g, float b, float a, Vector3 pos, int snap)
void skeletonsAscending(std::vector< Skeleton * > &skeletons)
Return copy of skeletons' addresses in ascending order (graph hierarchy)
const Skeleton * skeleton(size_t index) const
void switchDirection()
Change direction of the edge by exchanging pred. and succ. node.
Vector3 extent() const
Get the edge's extent.
void skeletonsDescending(std::vector< Skeleton * > &skeletons)
Return copy of skeletons' addresses in descending order (graph hierarchy)
void setSucc(VesselNode *node)
Connect edge-tail to node node.
Skeleton * createSkeleton(const ImageVector &pos, double minDistance=0.0, double maxDistance=0.0)
Skeleton * createSkeleton(const Vector3 &pos=Vector3(0), double minDistance=0.0, double maxDistance=0.0)
void setSTLabel(int nLabel)
Set label of edge and the attached subtree defined by edge directions.
SubImageBoxd getBoundingBox() const
Bounding box of the edge.
void removeLeadingSkeletons(size_t count)
const Skeleton * skeleton(Vector3 pos, int itemType) const
Get the skeleton with minimal distance to pos.
STATIC_GRAPH_PROPERTY(MLdouble, weight, Weight)
void setCycle()
Separate circles in the graph or connections between trees.
STATIC_GRAPH_PROPERTY(Vector3, STBarycenter, STBarycenter)
void skeletonsAscending(std::vector< Skeleton > &skeletons) const
Return copy of skeletons in ascending order (graph hierarchy from pred -> succ)
void smooth(unsigned int numSmoothingPasses, double positionSmoothingFactor, double radiusSmoothingFactor, double smoothingLimit=0.0f)
Smooths the skeletons' positions and radii.
bool markST(int a_label, float r, float g, float b, float a, Vector3 pos, int snap)
Set label and rgb color of edge and the attached subtree defined by edge directions.
const Skeleton * frontSkeleton() const
void addStateToTree(TreeNode *parent) const override
double distance(Vector3 vp) const
void orderSkeletonsAscending()
VesselNode * succNode()
Get the successor node of this edge.
Skeleton * createSkeleton(const Skeleton *skeletonTemplate)
void skeletonsDescending(std::vector< Skeleton > &skeletons) const
Return copy of skeletons in descending order (graph hierarchy from succ -> pred)
VesselEdge(const VesselEdge &other)
Copy constructor (creates an unconnected object, only copies properties), deprecated.
void setPred(VesselNode *node)
Connect edge-head to node node.
void skeletonsDescending(std::vector< const Skeleton * > &skeletons) const
Return copy of skeletons' addresses in descending order (graph hierarchy)
bool operator==(const VesselEdge &other) const
STATIC_GRAPH_PROPERTY(MLdouble, averageMinDistance, AverageMinDistance)
std::pair< MLdouble, size_t > getDistanceAndNearestSkeletonIndex(const Vector3 &pos) const
Skeleton * backSkeleton()
void clearSkeletons()
Encapsulate std::vector access.
size_t numSkeletons(void) const
STATIC_GRAPH_PROPERTY(MLdouble, volume, Volume)
STATIC_GRAPH_PROPERTY(MLdouble, length, Length)
const Skeleton * backSkeleton() const
ML_SET_ADDSTATE_VERSION(3)
Set current addStateToTree() version number:
bool operator!=(const VesselEdge &other) const
bool isSucc(const VesselNode *node) const
Is the graphNode the succeeding node of the edge?
void copyProperties(const VesselEdge *other)
Copy all properties (topology information is left unchanged)
~VesselEdge() override
Destructor.
void skeletonsAscending(std::vector< const Skeleton * > &skeletons) const
Return copy of skeletons' addresses in ascending order (graph hierarchy)
Skeleton * frontSkeleton()
bool skeletonsAreAscending() const
Returns if the skeletons are ordered ascending.
const VesselNode * succNode() const
void setSTLabel(Graph *pGraph)
Set label of edge and the attached subtree defined by edge directions according to labels of pGraph.
void convertToWorld(Matrix4 *mat)
STATIC_GRAPH_PROPERTY(MLint, hierarchy, Hierarchy)
bool isPred(const VesselNode *node) const
Is the graphNode the preceding node of the edge?
VesselNode is derived from GraphNode, hence it can be stored as node item in a class Graph object.
#define ML_ABSTRACT_CLASS_HEADER(className)
Same like ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non existing export symbol.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
#define VESSELGRAPH_END_NAMESPACE
#define VESSELGRAPH_EXPORT
Definiert systemspezifische Macros, die f"ur diese DLL gelten sollen.
#define VESSELGRAPH_BEGIN_NAMESPACE