bioprocessing
5.1.2
|
Volume graphs are a graph implementation specifically designed to represent volumes as graphs (vertices are the voxels, and edges are a chosen connectivity). More...
#include <bioprocessing/graph/volumegraph.h>
Classes | |
class | edge_const_iterator |
Iterator on the edges of a volume graph. More... | |
class | edge_iterator |
class | vertex_const_iterator |
Iterator on the vertices of a volume graph. More... | |
class | vertex_iterator |
Public Types | |
typedef T | Type |
Value type. More... | |
typedef P | Point |
Point type. More... | |
typedef Base::Edge | Edge |
Usable edge type (RC) More... | |
typedef Base::Vertex | Vertex |
Usable vertex type (RC) More... | |
typedef Base::Weight | Weight |
Weight type. More... | |
typedef VolumeGraphRef< T, P > | Graph |
Usable graph type (RC) More... | |
typedef VolumeGraphRef< T, P > | Ref |
Reference type. More... | |
typedef carto::VolumeRef< Type > | Volume |
Volume type. More... | |
![]() | |
typedef T | Weight |
Weight type. More... | |
typedef Base::Edge | Edge |
Usable edge type. More... | |
typedef Base::Vertex | Vertex |
Usable vertex type. More... | |
typedef EWBaseGraphRef< SetEdgeRef< PointVertexRef< P > >, T > | Graph |
Usable graph type. More... | |
typedef EWBaseGraphRef< SetEdgeRef< PointVertexRef< P > >, T > | Ref |
Reference type. More... | |
![]() | |
typedef E | Edge |
Usable edge type. More... | |
typedef Edge::Vertex | Vertex |
Usable vertex type. More... | |
typedef BaseGraphRef< E > | Graph |
Usable graph type. More... | |
typedef BaseGraphRef< E > | Ref |
Reference type. More... | |
Public Member Functions | |
VolumeGraph (int sx=1, int sy=1, int sz=1, int st=1, const aims::strel::Connectivity &conn=aims::strel::Connectivity6XYZ()) | |
Constructor from volume dimensions and connectivity This initializes the graph so that it represents a volume of size sx * sy * sz * st, with edges representing a connectivity conn . More... | |
VolumeGraph (const Volume &in, const aims::strel::Connectivity &conn=aims::strel::Connectivity6XYZ()) | |
Constructor from an exisiting volume and connectivity The volume is not copied, a reference to it is made. More... | |
virtual | ~VolumeGraph () |
vertex_const_iterator | beginVertex () const |
Iterator on all edges (This::Edge) More... | |
vertex_const_iterator | endVertex () const |
Iterator on all vertices. More... | |
vertex_iterator | beginVertex () |
Iterator on all vertices. More... | |
vertex_iterator | endVertex () |
Iterator on all vertices. More... | |
edge_const_iterator | beginEdge (const Vertex &v) const |
Iterator on the edges containing a given vertex. More... | |
edge_const_iterator | endEdge (const Vertex &v) const |
Iterator on the edges containing a given vertex. More... | |
edge_iterator | beginEdge (const Vertex &v) |
Iterator on the edges containing a given vertex. More... | |
edge_iterator | endEdge (const Vertex &v) |
Iterator on the edges containing a given vertex. More... | |
edge_const_iterator | beginEdge () const |
edge_const_iterator | endEdge () const |
edge_iterator | beginEdge () |
edge_iterator | endEdge () |
void | insert (Vertex v) |
Insertion of a new vertex (undefined for now) More... | |
void | insert (Edge e) |
Insertion of a new edge (undefined for now) More... | |
bool | contains (const Vertex &v) const |
True if v is in the graph. More... | |
bool | contains (const Edge &e) const |
True if e is in the graph. More... | |
bool | empty () const |
True if the graph contains no edges and vertices. More... | |
void | clear () |
Clear the graph from all edges and vertices. More... | |
void | insert (Edge e, Weight w=(Weight) 0) |
Insertion of a weighted edge (undefined for now) More... | |
Weight | weight (const Edge &e) |
Returns the weight of e . More... | |
Weight | weight (const Edge &e) const |
Returns the weight of e . More... | |
bool | isAdjacent (const Vertex &x, const Vertex &y) const |
Are x and y adjacent in the graph ? More... | |
bool | isLinked (const Vertex &x, const Vertex &y) const |
Are x and y linked in the graph ? More... | |
bool | isSubGraph (const Graph &g) const |
Is g a sub-graph os this graph ? (Meaning all its edges and vertices are included in this graph) More... | |
bool | isConnectedComponent (const Graph &g) const |
Is g a connected component in this graph (Meaning all its vertices are linked) More... | |
bool | isAdjacentTo (const Vertex &v, const Graph &g) const |
Is v adjacent to g ? (Meaning v isn't in g and there exist an edge in this graph that contains v and a vertex of g) More... | |
bool | isAdjacentFrom (const Vertex &v, const Graph &g) const |
Graph | getConnectedComponent (Vertex &v) |
Returns the (one and only) connected component of this graph containing v. More... | |
Weight | Fm (const Vertex &v) const |
Returns the minimum weight of all edges containing v. More... | |
void | setDimensions (int sx=1, int sy=1, int sz=1, int st=1) |
Sets the dimensions of the underlying volume. More... | |
void | setDimensions (const Point &dim) |
Sets the dimensions of the underlying volume. More... | |
void | setHeader (float vx=1., float vy=1., float vz=1., float vt=1.) |
Sets the header of the underlying volume. More... | |
void | setHeader (const Point4df &vs) |
Sets the header of the underlying volume. More... | |
void | setWeightMethod (Weight(*weight)(const Type &, const Type &)) |
Sets the weight method. More... | |
template<typename M > | |
void | mask (const carto::VolumeRef< M > &mask) |
Mask the underlying volume using mask. More... | |
T & | access (const Point &p) |
Access the volume at voxel p. More... | |
const T & | access (const Point &p) const |
Access the volume at voxel p. More... | |
bool | inside (const Point &p) const |
True if p is a voxel from the underlying volume. More... | |
![]() | |
virtual | ~EWBaseGraph () |
virtual void | insert (Edge e, Weight w=(Weight) 0) |
virtual Weight | weight (const Graph &g) const |
virtual bool | isMinimum (const Graph &g) const |
virtual bool | isMinimumSpanningForestRelativeTo (const Graph &h, const Graph &g) const |
virtual bool | isMinimumSpanningTree (const Graph &g) const |
bool | isDescending (const Path &p) const |
bool | isPathofSteepestdescent (const Path &p) const |
bool | isWatershedCut (const EdgeSet &s) const |
bool | isBasinCut (const EdgeSet &es) const |
virtual Graph | getMinOfF () const |
T | Fm (const G &thisg, const Vertex &v) |
![]() | |
virtual | ~BaseGraph () |
virtual bool | operator== (const This &other) const |
virtual bool | operator!= (const This &other) const |
virtual bool | operator> (const This &other) const |
virtual bool | operator< (const This &other) const |
virtual bool | operator>= (const This &other) const |
virtual bool | operator<= (const This &other) const |
virtual bool | operator= (const This &other) |
virtual bool | isAdjacent (const Edge &e) const |
virtual bool | isLinked (const Vertex &v) const |
virtual bool | isExtension (const Graph &h, const Graph &g) const |
virtual bool | isForestRelativeTo (const Graph &h, const Graph &g) const |
virtual bool | isSpanningForestRelativeTo (const Graph &h, const Graph &g) const |
virtual bool | isTree (const Graph &g) const |
virtual bool | isSpanningTree (const Graph &g) const |
virtual bool | isForest (const Graph &g) const |
virtual bool | isSpanningForest (const Graph &g) const |
template<typename EdgeIterator > | |
bool | isGraphCut (EdgeIterator begin, EdgeIterator end, const Graph &g) const |
template<typename EdgeSet > | |
bool | isGraphCut (const EdgeSet &es, const Graph &g) const |
Static Public Member Functions | |
template<typename Set > | |
static Set | getComplement (const Set &s, const Set &e) |
Returns the complement of s in e. More... | |
static Type | notPresentValue () |
Value whose meaning is "none". More... | |
static Type | presentValue () |
Value whose meaning is "present". More... | |
![]() | |
template<typename Set > | |
static Set | getComplement (const Set &s, const Set &e) |
Protected Types | |
typedef VolumeGraph< T, P > | This |
Type of *this. More... | |
typedef EWBaseGraph< SetEdgeRef< PointVertexRef< P > >, T > | Base |
Base class (EWBaseGraph) More... | |
typedef BaseGraph< SetEdgeRef< PointVertexRef< P > > > | BaseBase |
Base class of Base (BaseGraph) More... | |
![]() | |
typedef EWBaseGraph< SetEdgeRef< PointVertexRef< P > >, T > | This |
Type of *this. More... | |
typedef BaseGraph< SetEdgeRef< PointVertexRef< P > > > | Base |
Base class. More... | |
![]() | |
typedef BaseGraph< E > | This |
Type of *this. More... | |
Protected Attributes | |
Volume | _vol |
Weight(* | _weight )(const Type &, const Type &) |
aims::StructuringElement | _conn |
Additional Inherited Members | |
![]() | |
static Weight | Fm (const G &thisg, const Vertex &v) |
![]() | |
template<typename G > | |
static bool | isAdjacent (const G &thisg, const Vertex &x, const Vertex &y) |
These methods are templated on the iterator type (which is implementation dependant and thus not known in BaseGraph). More... | |
template<typename G > | |
static bool | isLinked (const G &thisg, const Vertex &x, const Vertex &y) |
template<typename VertexSet , typename G > | |
static bool | isLinked (const G &thisg, const Vertex &x, const Vertex &y, VertexSet &s) |
template<typename G > | |
static bool | isSubGraph (const G &thisg, const typename G::Ref &g) |
template<typename G > | |
static bool | isConnectedComponent (const G &thisg, const typename G::Ref &g) |
template<typename G > | |
static bool | isAdjacent (const G &thisg, const Edge &e) |
template<typename G > | |
static bool | isAdjacentTo (const G &thisg, const Vertex &v, const typename G::Ref &g) |
template<typename G > | |
static bool | isAdjacentFrom (const G &thisg, const Vertex &v, const typename G::Ref &g) |
template<typename G > | |
static G::Ref | getConnectedComponent (G &thisg, Vertex &v) |
template<typename G > | |
static void | getConnectedComponent (G &thisg, Vertex &v, typename G::Ref &g) |
Volume graphs are a graph implementation specifically designed to represent volumes as graphs (vertices are the voxels, and edges are a chosen connectivity).
To optimize the memory allocated by those graphs, they are actually stored as volumes. Vertices are thus PointVertexRef, and it is not possible to insert vertices that do not represent voxels present in the underlying volume.
Voxels from the underlying volume are considered not present if they take a given value (see notPresentValue()). By default, all the voxels from the volume are present. If construction is done based on an existing volume, its values are kept. Else, a default "present" value is given to the voxels.
Definition at line 57 of file volumegraph.h.
|
protected |
Base class (EWBaseGraph)
Definition at line 62 of file volumegraph.h.
|
protected |
Base class of Base (BaseGraph)
Definition at line 63 of file volumegraph.h.
typedef Base::Edge bio::VolumeGraph< T, P >::Edge |
Usable edge type (RC)
Definition at line 67 of file volumegraph.h.
typedef VolumeGraphRef<T,P> bio::VolumeGraph< T, P >::Graph |
Usable graph type (RC)
Definition at line 70 of file volumegraph.h.
typedef P bio::VolumeGraph< T, P >::Point |
Point type.
Definition at line 66 of file volumegraph.h.
typedef VolumeGraphRef<T,P> bio::VolumeGraph< T, P >::Ref |
Reference type.
Definition at line 71 of file volumegraph.h.
|
protected |
Type of *this.
Definition at line 61 of file volumegraph.h.
typedef T bio::VolumeGraph< T, P >::Type |
Value type.
Definition at line 65 of file volumegraph.h.
typedef Base::Vertex bio::VolumeGraph< T, P >::Vertex |
Usable vertex type (RC)
Definition at line 68 of file volumegraph.h.
typedef carto::VolumeRef<Type> bio::VolumeGraph< T, P >::Volume |
Volume type.
Definition at line 72 of file volumegraph.h.
typedef Base::Weight bio::VolumeGraph< T, P >::Weight |
Weight type.
Definition at line 69 of file volumegraph.h.
bio::VolumeGraph< T, P >::VolumeGraph | ( | int | sx = 1 , |
int | sy = 1 , |
||
int | sz = 1 , |
||
int | st = 1 , |
||
const aims::strel::Connectivity & | conn = aims::strel::Connectivity6XYZ() |
||
) |
Constructor from volume dimensions and connectivity This initializes the graph so that it represents a volume of size sx * sy * sz * st, with edges representing a connectivity conn
.
Definition at line 222 of file volumegraph.h.
bio::VolumeGraph< T, P >::VolumeGraph | ( | const Volume & | in, |
const aims::strel::Connectivity & | conn = aims::strel::Connectivity6XYZ() |
||
) |
Constructor from an exisiting volume and connectivity The volume is not copied, a reference to it is made.
As such, any change to the VolumeGraph is a change to this volume.
Definition at line 230 of file volumegraph.h.
|
inlinevirtual |
Definition at line 88 of file volumegraph.h.
T & bio::VolumeGraph< T, P >::access | ( | const Point & | p | ) |
Access the volume at voxel p.
Definition at line 364 of file volumegraph.h.
const T & bio::VolumeGraph< T, P >::access | ( | const Point & | p | ) | const |
Access the volume at voxel p.
Definition at line 373 of file volumegraph.h.
edge_iterator bio::VolumeGraph< T, P >::beginEdge | ( | ) |
edge_const_iterator bio::VolumeGraph< T, P >::beginEdge | ( | ) | const |
|
inline |
Iterator on the edges containing a given vertex.
Definition at line 111 of file volumegraph.h.
References bio::VolumeGraph< T, P >::_conn, and bio::VolumeGraph< T, P >::_vol.
|
inline |
Iterator on the edges containing a given vertex.
Definition at line 105 of file volumegraph.h.
References bio::VolumeGraph< T, P >::_conn, and bio::VolumeGraph< T, P >::_vol.
|
inline |
Iterator on all vertices.
Definition at line 101 of file volumegraph.h.
References bio::VolumeGraph< T, P >::_vol.
|
inline |
Iterator on all edges (This::Edge)
Iterator on all vertices
Definition at line 97 of file volumegraph.h.
References bio::VolumeGraph< T, P >::_vol.
|
virtual |
Clear the graph from all edges and vertices.
Reimplemented from bio::BaseGraph< E >.
Definition at line 269 of file volumegraph.h.
|
virtual |
True if e
is in the graph.
Reimplemented from bio::BaseGraph< E >.
Definition at line 247 of file volumegraph.h.
|
virtual |
True if v
is in the graph.
Reimplemented from bio::BaseGraph< E >.
Definition at line 238 of file volumegraph.h.
|
virtual |
True if the graph contains no edges and vertices.
Reimplemented from bio::BaseGraph< E >.
Definition at line 256 of file volumegraph.h.
edge_iterator bio::VolumeGraph< T, P >::endEdge | ( | ) |
edge_const_iterator bio::VolumeGraph< T, P >::endEdge | ( | ) | const |
|
inline |
Iterator on the edges containing a given vertex.
Definition at line 114 of file volumegraph.h.
References bio::VolumeGraph< T, P >::_conn, and bio::VolumeGraph< T, P >::_vol.
|
inline |
Iterator on the edges containing a given vertex.
Definition at line 108 of file volumegraph.h.
References bio::VolumeGraph< T, P >::_conn, and bio::VolumeGraph< T, P >::_vol.
|
inline |
Iterator on all vertices.
Definition at line 103 of file volumegraph.h.
References bio::VolumeGraph< T, P >::_vol.
|
inline |
Iterator on all vertices.
Definition at line 99 of file volumegraph.h.
References bio::VolumeGraph< T, P >::_vol.
|
inlinevirtual |
Returns the minimum weight of all edges containing v.
Reimplemented from bio::EWBaseGraph< SetEdgeRef< PointVertexRef< P > >, T >.
Definition at line 174 of file volumegraph.h.
References bio::EWBaseGraph< SetEdgeRef< PointVertexRef< P > >, T >::Fm().
|
inlinestatic |
Returns the complement of s in e.
Definition at line 178 of file volumegraph.h.
References bio::BaseGraph< E >::getComplement().
Referenced by bio::VolumeGraphRef< T, P >::getComplement().
|
inline |
Returns the (one and only) connected component of this graph containing v.
Definition at line 171 of file volumegraph.h.
References bio::BaseGraph< E >::getConnectedComponent().
|
inlinevirtual |
Insertion of a new edge (undefined for now)
Reimplemented from bio::BaseGraph< E >.
Definition at line 130 of file volumegraph.h.
|
inline |
Insertion of a weighted edge (undefined for now)
Definition at line 140 of file volumegraph.h.
|
inlinevirtual |
Insertion of a new vertex (undefined for now)
Reimplemented from bio::BaseGraph< E >.
Definition at line 128 of file volumegraph.h.
bool bio::VolumeGraph< T, P >::inside | ( | const Point & | p | ) | const |
True if p is a voxel from the underlying volume.
Definition at line 382 of file volumegraph.h.
Referenced by bio::VolumeGraph< T, P >::edge_const_iterator::toNext().
|
inlinevirtual |
Are x and y adjacent in the graph ?
Reimplemented from bio::BaseGraph< E >.
Definition at line 149 of file volumegraph.h.
References bio::BaseGraph< E >::isAdjacent().
|
inlinevirtual |
Reimplemented from bio::BaseGraph< E >.
Definition at line 167 of file volumegraph.h.
References bio::BaseGraph< E >::isAdjacentFrom().
|
inlinevirtual |
Is v adjacent to g ? (Meaning v isn't in g and there exist an edge in this graph that contains v and a vertex of g)
Reimplemented from bio::BaseGraph< E >.
Definition at line 165 of file volumegraph.h.
References bio::BaseGraph< E >::isAdjacentTo().
|
inlinevirtual |
Is g a connected component in this graph (Meaning all its vertices are linked)
Reimplemented from bio::BaseGraph< E >.
Definition at line 160 of file volumegraph.h.
References bio::BaseGraph< E >::isConnectedComponent().
|
inlinevirtual |
Are x and y linked in the graph ?
Reimplemented from bio::BaseGraph< E >.
Definition at line 152 of file volumegraph.h.
References bio::BaseGraph< E >::isLinked().
|
inlinevirtual |
Is g a sub-graph os this graph ? (Meaning all its edges and vertices are included in this graph)
Reimplemented from bio::BaseGraph< E >.
Definition at line 156 of file volumegraph.h.
References bio::BaseGraph< E >::isSubGraph().
void bio::VolumeGraph< T, P >::mask | ( | const carto::VolumeRef< M > & | mask | ) |
Mask the underlying volume using mask.
i.e. All voxels/vertices not present in the mask are set to notPresentValue()
Definition at line 348 of file volumegraph.h.
|
static |
Value whose meaning is "none".
Definition at line 298 of file volumegraph.h.
Referenced by bio::VolumeGraphRef< T, P >::notPresentValue(), bio::VolumeGraph< T, P >::vertex_const_iterator::operator++(), and bio::VolumeGraph< T, P >::vertex_const_iterator::vertex_const_iterator().
|
static |
Value whose meaning is "present".
Definition at line 304 of file volumegraph.h.
Referenced by bio::VolumeGraphRef< T, P >::presentValue().
void bio::VolumeGraph< T, P >::setDimensions | ( | const Point & | dim | ) |
Sets the dimensions of the underlying volume.
Definition at line 316 of file volumegraph.h.
void bio::VolumeGraph< T, P >::setDimensions | ( | int | sx = 1 , |
int | sy = 1 , |
||
int | sz = 1 , |
||
int | st = 1 |
||
) |
Sets the dimensions of the underlying volume.
Definition at line 310 of file volumegraph.h.
void bio::VolumeGraph< T, P >::setHeader | ( | const Point4df & | vs | ) |
Sets the header of the underlying volume.
Definition at line 335 of file volumegraph.h.
void bio::VolumeGraph< T, P >::setHeader | ( | float | vx = 1. , |
float | vy = 1. , |
||
float | vz = 1. , |
||
float | vt = 1. |
||
) |
Sets the header of the underlying volume.
Definition at line 325 of file volumegraph.h.
void bio::VolumeGraph< T, P >::setWeightMethod | ( | Weight(*)(const Type &, const Type &) | weight | ) |
Sets the weight method.
A weight method takes two voxels values and returns a weight.
Definition at line 341 of file volumegraph.h.
|
virtual |
Returns the weight of e
.
Reimplemented from bio::EWBaseGraph< SetEdgeRef< PointVertexRef< P > >, T >.
Definition at line 280 of file volumegraph.h.
|
virtual |
Returns the weight of e
.
Reimplemented from bio::EWBaseGraph< SetEdgeRef< PointVertexRef< P > >, T >.
Definition at line 289 of file volumegraph.h.
|
protected |
Definition at line 214 of file volumegraph.h.
Referenced by bio::VolumeGraph< T, P >::beginEdge(), and bio::VolumeGraph< T, P >::endEdge().
|
protected |
Definition at line 212 of file volumegraph.h.
Referenced by bio::VolumeGraph< T, P >::beginEdge(), bio::VolumeGraph< T, P >::beginVertex(), bio::VolumeGraph< T, P >::endEdge(), bio::VolumeGraph< T, P >::endVertex(), bio::VolumeGraph< T, P >::vertex_const_iterator::operator++(), bio::VolumeGraph< T, P >::vertex_const_iterator::operator=(), bio::VolumeGraph< T, P >::edge_const_iterator::operator=(), and bio::VolumeGraph< T, P >::vertex_const_iterator::vertex_const_iterator().
|
protected |
Definition at line 213 of file volumegraph.h.