Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Connectomics Network Class. More...
#include <mitkConnectomicsNetwork.h>
Classes | |
struct | NetworkEdge |
struct | NetworkNode |
Public Types | |
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, NetworkNode, NetworkEdge > | NetworkType |
typedef boost::graph_traits< NetworkType >::vertex_descriptor | VertexDescriptorType |
typedef boost::graph_traits< NetworkType >::edge_descriptor | EdgeDescriptorType |
Public Types inherited from mitk::BaseData | |
typedef BaseData | Self |
typedef itk::DataObject | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
Public Member Functions | |
virtual void | UpdateOutputInformation () override |
virtual void | SetRequestedRegionToLargestPossibleRegion () override |
Set the RequestedRegion to the LargestPossibleRegion. More... | |
virtual bool | RequestedRegionIsOutsideOfTheBufferedRegion () override |
Determine whether the RequestedRegion is outside of the BufferedRegion. More... | |
virtual bool | VerifyRequestedRegion () override |
Verify that the RequestedRegion is within the LargestPossibleRegion. More... | |
virtual void | SetRequestedRegion (const itk::DataObject *) override |
Set the requested region from this data object to match the requested region of the data object passed in as a parameter. More... | |
mitkClassMacro (ConnectomicsNetwork, BaseData) | |
Pointer | Clone () const |
bool | EdgeExists (VertexDescriptorType vertexA, VertexDescriptorType vertexB) const |
void | IncreaseEdgeWeight (VertexDescriptorType vertexA, VertexDescriptorType vertexB) |
void | AddEdge (VertexDescriptorType vertexA, VertexDescriptorType vertexB) |
void | AddEdge (VertexDescriptorType vertexA, VertexDescriptorType vertexB, int sourceID, int targetID, int weight=1, double edge_weight=1.0) |
VertexDescriptorType | AddVertex (int id) |
void | SetLabel (VertexDescriptorType vertex, std::string inLabel) |
void | SetCoordinates (VertexDescriptorType vertex, std::vector< float > inCoordinates) |
void | clear () |
NetworkNode | GetNode (VertexDescriptorType vertex) const |
NetworkEdge | GetEdge (VertexDescriptorType vertexA, VertexDescriptorType vertexB) const |
std::vector< NetworkNode > | GetVectorOfAllNodes () const |
std::vector< VertexDescriptorType > | GetVectorOfAllVertexDescriptors () const |
std::vector< VertexDescriptorType > | GetVectorOfAdjacentNodes (VertexDescriptorType vertex) const |
std::vector< std::pair< std::pair< NetworkNode, NetworkNode >, NetworkEdge > > | GetVectorOfAllEdges () const |
int | GetNumberOfVertices () const |
int | GetNumberOfEdges () const |
int | GetNumberOfSelfLoops () |
double | GetAverageDegree () |
double | GetConnectionDensity () |
int | GetMaximumWeight () const |
std::vector< int > | GetDegreeOfNodes () const |
int | GetMaximumDegree () const |
std::vector< double > | GetLocalClusteringCoefficients () const |
std::vector< double > | GetClusteringCoefficientsByDegree () |
double | GetGlobalClusteringCoefficient () |
std::vector< double > | GetNodeBetweennessVector () const |
std::vector< double > | GetEdgeBetweennessVector () const |
bool | CheckForLabel (std::string targetLabel) const |
std::vector< double > | GetShortestDistanceVectorFromLabel (std::string targetLabel) const |
NetworkType * | GetBoostGraph () |
void | SetBoostGraph (NetworkType *newGraph) |
void | ImportNetwort (mitk::ConnectomicsNetwork::Pointer source) |
bool | GetIsModified () const |
void | SetIsModified (bool) |
void | UpdateBounds () |
void | PruneUnconnectedSingleNodes () |
void | UpdateIDs () |
Public Member Functions inherited from mitk::BaseData | |
virtual std::vector< std::string > | GetClassHierarchy () const |
virtual const char * | GetClassName () const |
const mitk::TimeGeometry * | GetTimeGeometry () const |
Return the TimeGeometry of the data as const pointer. More... | |
const mitk::TimeGeometry * | GetTimeSlicedGeometry () const |
Return the TimeGeometry of the data as const pointer. More... | |
mitk::TimeGeometry * | GetTimeGeometry () |
Return the TimeGeometry of the data as pointer. More... | |
const mitk::TimeGeometry * | GetUpdatedTimeGeometry () |
Return the TimeGeometry of the data. More... | |
const mitk::TimeGeometry * | GetUpdatedTimeSliceGeometry () |
Return the TimeGeometry of the data. More... | |
virtual void | Expand (unsigned int timeSteps) |
Expands the TimeGeometry to a number of TimeSteps. More... | |
const mitk::BaseGeometry * | GetUpdatedGeometry (int t=0) |
Return the BaseGeometry of the data at time t. More... | |
mitk::BaseGeometry * | GetGeometry (int t=0) const |
Return the geometry, which is a TimeGeometry, of the data as non-const pointer. More... | |
void | UpdateOutputInformation () override |
Update the information for this BaseData (the geometry in particular) so that it can be used as an output of a BaseProcess. More... | |
void | CopyInformation (const itk::DataObject *data) override |
Copy information from the specified data set. More... | |
virtual bool | IsInitialized () const |
Check whether the data has been initialized, i.e., at least the Geometry and other header data has been set. More... | |
virtual void | Clear () |
Calls ClearData() and InitializeEmpty();. More... | |
virtual bool | IsEmptyTimeStep (unsigned int t) const |
Check whether object contains data (at a specified time), e.g., a set of points may be empty. More... | |
virtual bool | IsEmpty () const |
Check whether object contains data (at least at one point in time), e.g., a set of points may be empty. More... | |
void | ExecuteOperation (Operation *operation) override |
overwrite if the Data can be called by an Interactor (StateMachine). More... | |
virtual void | SetGeometry (BaseGeometry *aGeometry3D) |
Set the BaseGeometry of the data, which will be referenced (not copied!). Assumes the data object has only 1 time step ( is a 3D object ) and creates a new TimeGeometry which saves the given BaseGeometry. If an TimeGeometry has already been set for the object, it will be replaced after calling this function. More... | |
virtual void | SetTimeGeometry (TimeGeometry *geometry) |
Set the TimeGeometry of the data, which will be referenced (not copied!). More... | |
virtual void | SetClonedGeometry (const BaseGeometry *aGeometry3D) |
Set a clone of the provided TimeGeometry as TimeGeometry of the data. Assumes the data object has only 1 time step ( is a 3D object ) and creates a new TimeGeometry. If an TimeGeometry has already been set for the object, it will be replaced after calling this function. More... | |
virtual void | SetClonedTimeGeometry (const TimeGeometry *geometry) |
Set a clone of the provided TimeGeometry as TimeGeometry of the data. More... | |
virtual void | SetClonedGeometry (const BaseGeometry *aGeometry3D, unsigned int time) |
Set a clone of the provided geometry as BaseGeometry of a given time step. More... | |
mitk::PropertyList::Pointer | GetPropertyList () const |
Get the data's property list. More... | |
void | SetPropertyList (PropertyList *propertyList) |
Set the data's property list. More... | |
mitk::BaseProperty::Pointer | GetProperty (const char *propertyKey) const |
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList, and set it to this, respectively;. More... | |
void | SetProperty (const char *propertyKey, BaseProperty *property) |
virtual void | SetOrigin (const Point3D &origin) |
Convenience method for setting the origin of the BaseGeometry instances of all time steps. More... | |
itk::SmartPointer< mitk::BaseDataSource > | GetSource () const |
Get the process object that generated this data object. More... | |
unsigned int | GetTimeSteps () const |
Get the number of time steps from the TimeGeometry As the base data has not a data vector given by itself, the number of time steps is defined over the time sliced geometry. In sub classes, a better implementation could be over the length of the data vector. More... | |
virtual unsigned long | GetMTime () const override |
Get the modified time of the last change of the contents this data object or its geometry. More... | |
virtual void | Graft (const DataObject *) override |
Public Member Functions inherited from mitk::OperationActor | |
itkTypeMacroNoParent (OperationActor) virtual ~OperationActor() | |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from mitk::BaseData | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
ConnectomicsNetwork () | |
virtual | ~ConnectomicsNetwork () |
Protected Member Functions inherited from mitk::BaseData | |
BaseData () | |
BaseData (const BaseData &other) | |
~BaseData () | |
virtual void | InitializeTimeGeometry (unsigned int timeSteps=1) |
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More... | |
virtual void | InitializeTimeSlicedGeometry (unsigned int timeSteps=1) |
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More... | |
virtual void | ClearData () |
reset to non-initialized state, release memory More... | |
virtual void | InitializeEmpty () |
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least create one empty object and call Superclass::InitializeTimeGeometry() to ensure an existing valid geometry. More... | |
virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
Protected Attributes | |
NetworkType | m_Network |
bool | m_IsModified |
Protected Attributes inherited from mitk::BaseData | |
bool | m_LastRequestedRegionWasOutsideOfTheBufferedRegion |
unsigned int | m_SourceOutputIndexDuplicate |
bool | m_Initialized |
Connectomics Network Class.
This class is designed to represent a connectomics network (brain network). It encapsulates a boost adjacency list and provides additional capabilities. The information contained in the nodes and edges is:
Network Node:
Network Edge:
Definition at line 53 of file mitkConnectomicsNetwork.h.
typedef boost::graph_traits<NetworkType>::edge_descriptor mitk::ConnectomicsNetwork::EdgeDescriptorType |
Definition at line 79 of file mitkConnectomicsNetwork.h.
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, NetworkNode, NetworkEdge > mitk::ConnectomicsNetwork::NetworkType |
Typedefs
Definition at line 77 of file mitkConnectomicsNetwork.h.
typedef boost::graph_traits<NetworkType>::vertex_descriptor mitk::ConnectomicsNetwork::VertexDescriptorType |
Definition at line 78 of file mitkConnectomicsNetwork.h.
|
protected |
Definition at line 24 of file mitkConnectomicsNetwork.cpp.
|
protectedvirtual |
Definition at line 29 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::AddEdge | ( | VertexDescriptorType | vertexA, |
VertexDescriptorType | vertexB | ||
) |
add an edge between two given vertices
Definition at line 49 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::AddEdge | ( | VertexDescriptorType | vertexA, |
VertexDescriptorType | vertexB, | ||
int | sourceID, | ||
int | targetID, | ||
int | weight = 1 , |
||
double | edge_weight = 1.0 |
||
) |
add an edge between two given vertices ( with a specific weight )
Definition at line 57 of file mitkConnectomicsNetwork.cpp.
mitk::ConnectomicsNetwork::VertexDescriptorType mitk::ConnectomicsNetwork::AddVertex | ( | int | id | ) |
add a vertex with a specified id
Definition at line 71 of file mitkConnectomicsNetwork.cpp.
bool mitk::ConnectomicsNetwork::CheckForLabel | ( | std::string | targetLabel | ) | const |
Check whether a vertex with the specified label exists
Definition at line 703 of file mitkConnectomicsNetwork.cpp.
Referenced by main().
void mitk::ConnectomicsNetwork::clear | ( | ) |
clear the graph
Definition at line 97 of file mitkConnectomicsNetwork.cpp.
Pointer mitk::ConnectomicsNetwork::Clone | ( | ) | const |
bool mitk::ConnectomicsNetwork::EdgeExists | ( | VertexDescriptorType | vertexA, |
VertexDescriptorType | vertexB | ||
) | const |
return whether an edge exists between the two given vertices
Definition at line 35 of file mitkConnectomicsNetwork.cpp.
double mitk::ConnectomicsNetwork::GetAverageDegree | ( | ) |
get number of vertices, that are connected to themselves
Definition at line 274 of file mitkConnectomicsNetwork.cpp.
mitk::ConnectomicsNetwork::NetworkType * mitk::ConnectomicsNetwork::GetBoostGraph | ( | ) |
Access boost graph directly
Definition at line 436 of file mitkConnectomicsNetwork.cpp.
Referenced by mitk::ConnectomicsBetweennessHistogram::ComputeFromConnectomicsNetwork(), and mitk::ConnectomicsShortestPathHistogram::ComputeFromConnectomicsNetwork().
std::vector< double > mitk::ConnectomicsNetwork::GetClusteringCoefficientsByDegree | ( | ) |
Get a vector in the format vector[ degree ] = average clustering coefficient
Definition at line 373 of file mitkConnectomicsNetwork.cpp.
double mitk::ConnectomicsNetwork::GetConnectionDensity | ( | ) |
get number of edges divided by number of possible edges
Definition at line 282 of file mitkConnectomicsNetwork.cpp.
std::vector< int > mitk::ConnectomicsNetwork::GetDegreeOfNodes | ( | ) | const |
Get a vector in the format vector[ vertexID ] = degree
Definition at line 291 of file mitkConnectomicsNetwork.cpp.
Referenced by mitk::ConnectomicsDegreeHistogram::ComputeFromConnectomicsNetwork().
mitk::ConnectomicsNetwork::NetworkEdge mitk::ConnectomicsNetwork::GetEdge | ( | VertexDescriptorType | vertexA, |
VertexDescriptorType | vertexB | ||
) | const |
return the edge struct for two given node descriptors
Definition at line 504 of file mitkConnectomicsNetwork.cpp.
References mitkThrow.
std::vector< double > mitk::ConnectomicsNetwork::GetEdgeBetweennessVector | ( | ) | const |
Get the betweenness centrality for each edge in form of a vector of length (number edges)
Definition at line 637 of file mitkConnectomicsNetwork.cpp.
double mitk::ConnectomicsNetwork::GetGlobalClusteringCoefficient | ( | ) |
Get the global clustering coefficient
Definition at line 407 of file mitkConnectomicsNetwork.cpp.
bool mitk::ConnectomicsNetwork::GetIsModified | ( | ) | const |
Get the modified flag
Definition at line 486 of file mitkConnectomicsNetwork.cpp.
std::vector< double > mitk::ConnectomicsNetwork::GetLocalClusteringCoefficients | ( | ) | const |
Get a vector in the format vector[ vertexID ] = clustering coefficient
Definition at line 344 of file mitkConnectomicsNetwork.cpp.
References MITK_ERROR.
int mitk::ConnectomicsNetwork::GetMaximumDegree | ( | ) | const |
Get the maximum degree of all nodes
Definition at line 327 of file mitkConnectomicsNetwork.cpp.
int mitk::ConnectomicsNetwork::GetMaximumWeight | ( | ) | const |
Get the maximum weight of all edges
Definition at line 214 of file mitkConnectomicsNetwork.cpp.
mitk::ConnectomicsNetwork::NetworkNode mitk::ConnectomicsNetwork::GetNode | ( | VertexDescriptorType | vertex | ) | const |
return the node struct for a given node descriptor
Definition at line 498 of file mitkConnectomicsNetwork.cpp.
std::vector< double > mitk::ConnectomicsNetwork::GetNodeBetweennessVector | ( | ) | const |
Get the betweenness centrality for each vertex in form of a vector of length (number vertices)
Definition at line 620 of file mitkConnectomicsNetwork.cpp.
int mitk::ConnectomicsNetwork::GetNumberOfEdges | ( | ) | const |
get overall number of edges in the network
Definition at line 209 of file mitkConnectomicsNetwork.cpp.
int mitk::ConnectomicsNetwork::GetNumberOfSelfLoops | ( | ) |
get number of vertices, that are connected to themselves
Definition at line 239 of file mitkConnectomicsNetwork.cpp.
int mitk::ConnectomicsNetwork::GetNumberOfVertices | ( | ) | const |
get overall number of vertices in the network
Definition at line 204 of file mitkConnectomicsNetwork.cpp.
Referenced by mitk::ConnectomicsBetweennessHistogram::ComputeFromConnectomicsNetwork().
std::vector< double > mitk::ConnectomicsNetwork::GetShortestDistanceVectorFromLabel | ( | std::string | targetLabel | ) | const |
Get the shortest distance from a specified vertex to all other vertices in form of a vector of length (number vertices)
Definition at line 676 of file mitkConnectomicsNetwork.cpp.
References MITK_WARN.
std::vector< mitk::ConnectomicsNetwork::VertexDescriptorType > mitk::ConnectomicsNetwork::GetVectorOfAdjacentNodes | ( | VertexDescriptorType | vertex | ) | const |
get vector containing the descriptors of nodes adjacent to the vertex denoted by the given descriptor
Definition at line 311 of file mitkConnectomicsNetwork.cpp.
std::vector< std::pair< std::pair< mitk::ConnectomicsNetwork::NetworkNode, mitk::ConnectomicsNetwork::NetworkNode >, mitk::ConnectomicsNetwork::NetworkEdge > > mitk::ConnectomicsNetwork::GetVectorOfAllEdges | ( | ) | const |
get vector containing all the edges of the network and the connected nodes
Definition at line 172 of file mitkConnectomicsNetwork.cpp.
std::vector< mitk::ConnectomicsNetwork::NetworkNode > mitk::ConnectomicsNetwork::GetVectorOfAllNodes | ( | ) | const |
get vector containing all the nodes of the network
Definition at line 129 of file mitkConnectomicsNetwork.cpp.
std::vector< mitk::ConnectomicsNetwork::VertexDescriptorType > mitk::ConnectomicsNetwork::GetVectorOfAllVertexDescriptors | ( | ) | const |
get vector containing all the vertex descriptors of the network
Definition at line 152 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::ImportNetwort | ( | mitk::ConnectomicsNetwork::Pointer | source | ) |
Definition at line 449 of file mitkConnectomicsNetwork.cpp.
References MITK_ERROR.
void mitk::ConnectomicsNetwork::IncreaseEdgeWeight | ( | VertexDescriptorType | vertexA, |
VertexDescriptorType | vertexB | ||
) |
increase the weight of an edge between the two given vertices
Definition at line 41 of file mitkConnectomicsNetwork.cpp.
mitk::ConnectomicsNetwork::mitkClassMacro | ( | ConnectomicsNetwork | , |
BaseData | |||
) |
|
static |
Referenced by mitk::ConnectomicsNetworkCreator::CreateNetworkFromFibersAndSegmentation(), mitk::ConnectomicsSyntheticNetworkGenerator::CreateSyntheticNetwork(), mitk::ConnectomicsNetworkReader::Read(), mitk::ConnectomicsSimulatedAnnealingPermutationModularity::splitModule(), mitk::ConnectomicsNetworkThresholder::Threshold(), mitk::ConnectomicsNetworkThresholder::ThresholdBelowDensity(), and mitk::ConnectomicsNetworkThresholder::ThresholdByRandomRemoval().
void mitk::ConnectomicsNetwork::PruneUnconnectedSingleNodes | ( | ) |
Remove nodes not connected to any other node
Definition at line 567 of file mitkConnectomicsNetwork.cpp.
|
overridevirtual |
Determine whether the RequestedRegion is outside of the BufferedRegion.
This method returns true if the RequestedRegion is outside the BufferedRegion (true if at least one pixel is outside). This is used by the pipeline mechanism to determine whether a filter needs to re-execute in order to satisfy the current request. If the current RequestedRegion is already inside the BufferedRegion from the previous execution (and the current filter is up to date), then a given filter does not need to re-execute
Implements mitk::BaseData.
Definition at line 113 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::SetBoostGraph | ( | NetworkType * | newGraph | ) |
Set the boost graph directly
Definition at line 441 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::SetCoordinates | ( | VertexDescriptorType | vertex, |
std::vector< float > | inCoordinates | ||
) |
set the coordinates of a vertex
Definition at line 89 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::SetIsModified | ( | bool | value | ) |
Set the modified flag
Definition at line 492 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::SetLabel | ( | VertexDescriptorType | vertex, |
std::string | inLabel | ||
) |
set the label of a vertex
Definition at line 81 of file mitkConnectomicsNetwork.cpp.
|
overridevirtual |
Set the requested region from this data object to match the requested region of the data object passed in as a parameter.
This method is implemented in the concrete subclasses of BaseData.
Implements mitk::BaseData.
Definition at line 121 of file mitkConnectomicsNetwork.cpp.
|
overridevirtual |
Set the RequestedRegion to the LargestPossibleRegion.
This forces a filter to produce all of the output in one execution (i.e. not streaming) on the next call to Update().
Implements mitk::BaseData.
Definition at line 109 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::UpdateBounds | ( | ) |
Update the bounds of the geometry to fit the network
Definition at line 516 of file mitkConnectomicsNetwork.cpp.
void mitk::ConnectomicsNetwork::UpdateIDs | ( | ) |
This function will relabel all vertices and edges in a continuous manner
Mainly important after removing vertices, to make sure that the ids run continuously from 0 to number of vertices - 1 and edge target and source ids match the corresponding node.
Definition at line 596 of file mitkConnectomicsNetwork.cpp.
|
overridevirtual |
Definition at line 105 of file mitkConnectomicsNetwork.cpp.
|
overridevirtual |
Verify that the RequestedRegion is within the LargestPossibleRegion.
If the RequestedRegion is not within the LargestPossibleRegion, then the filter cannot possibly satisfy the request. This method returns true if the request can be satisfied (even if it will be necessary to process the entire LargestPossibleRegion) and returns false otherwise. This method is used by PropagateRequestedRegion(). PropagateRequestedRegion() throws a InvalidRequestedRegionError exception if the requested region is not within the LargestPossibleRegion.
Implements mitk::BaseData.
Definition at line 117 of file mitkConnectomicsNetwork.cpp.
|
protected |
Flag which indicates whether the network has been modified since the last check
mainly for rendering purposes
Definition at line 219 of file mitkConnectomicsNetwork.h.
|
protected |
Definition at line 213 of file mitkConnectomicsNetwork.h.