13 #ifndef ML_VESSEL_EDGE_H
14 #define ML_VESSEL_EDGE_H
38 friend class LoadTreeData;
86 double distance(
Vector3 vp)
const {
return getDistanceAndNearestSkeletonIndex(vp).first; };
128 double maxDistance = 0.0);
130 double maxDistance = 0.0)
135 minDistance, maxDistance);
192 void smooth(
unsigned int numSmoothingPasses,
double positionSmoothingFactor,
double radiusSmoothingFactor,
double smoothingLimit = 0.0f );
209 std::vector <Skeleton*> _skeletons;
230 bool markST(
int a_label,
float r,
float g,
float b,
float a,
Vector3 pos,
int snap );
231 bool markEdge(
int a_label,
float r,
float g,
float b,
float a,
Vector3 pos,
int snap );
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 * frontSkeleton()
Skeleton * createSkeleton(const ImageVector &pos, double minDistance=0.0, double maxDistance=0.0)
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 Skeleton * skeleton(size_t index) 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)
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 * skeleton(size_t index)
void setSTLabel(int nLabel)
Set label of edge and the attached subtree defined by edge directions.
SubImageBoxd getBoundingBox() const
Bounding box of the edge.
const VesselNode * succNode() const
void removeLeadingSkeletons(size_t count)
STATIC_GRAPH_PROPERTY(MLdouble, weight, Weight)
void setCycle()
Separate circles in the graph or connections between trees.
STATIC_GRAPH_PROPERTY(Vector3, STBarycenter, STBarycenter)
std::pair< MLdouble, size_t > getDistanceAndNearestSkeletonIndex(const Vector3 &pos) const
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.
Skeleton * createSkeleton(const Skeleton *skeletonTemplate)
VesselNode * succNode()
Get the successor node of this edge.
void addStateToTree(TreeNode *parent) const override
double distance(Vector3 vp) const
void orderSkeletonsAscending()
const Skeleton * skeleton(Vector3 pos, int itemType) const
Get the skeleton with minimal distance to pos.
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.
Skeleton * backSkeleton()
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)
void clearSkeletons()
Encapsulate std::vector access.
size_t numSkeletons(void) const
const Skeleton * frontSkeleton() const
Skeleton * createSkeleton(const Vector3 &pos=Vector3(0), double minDistance=0.0, double maxDistance=0.0)
STATIC_GRAPH_PROPERTY(MLdouble, volume, Volume)
Skeleton * skeleton(Vector3 pos, int itemType)
Get the skeleton with minimal distance to pos.
STATIC_GRAPH_PROPERTY(MLdouble, length, Length)
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)
bool skeletonsAreAscending() const
Returns if the skeletons are ordered ascending.
const Skeleton * backSkeleton() 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)
const VesselNode * predNode() const
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)
Similar to ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non-existing export symbol.
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
Tmat4< MLdouble > Matrix4
The standard 4x4 matrix of type double.
Tvec3< MLdouble > Vector3
A vector with three components of type double.
TImageVector< MLint > ImageVector
Defines the standard ImageVector type that is used by the ML for indexing and coordinates.