20 #include <boost/numeric/conversion/converter.hpp>
25 : m_Mode( UnweightedUndirectedMode )
51 m_CentralityMap.clear();
56 case UnweightedUndirectedMode:
58 CalculateUnweightedUndirectedBetweennessCentrality( boostGraph, vertex_iterator_begin, vertex_iterator_end );
61 case WeightedUndirectedMode:
63 CalculateWeightedUndirectedBetweennessCentrality( boostGraph, vertex_iterator_begin, vertex_iterator_end );
68 ConvertCentralityMapToHistogram();
74 boost::brandes_betweenness_centrality(
76 boost::centrality_map(
91 double maximumFloat( 0.0 );
93 for (
unsigned int index( 0 ); index < m_CentralityMap.size(); index++ )
95 if( m_CentralityMap[ index ] > maximumFloat )
97 maximumFloat = m_CentralityMap[ index ];
103 typedef boost::numeric::converter<int,double> Double2Int ;
111 maximumInt = Double2Int::convert( maximumFloat );
113 catch ( boost::numeric::positive_overflow
const& )
118 m_HistogramVector.resize( maximumInt + 1 );
120 for (
unsigned int index( 0 ); index < m_CentralityMap.size(); index++ )
123 value = Double2Int::convert( ( m_CentralityMap[index ] + 0.5 ) );
124 m_HistogramVector[ value ]++;
virtual ~ConnectomicsBetweennessHistogram()
void SetBetweennessCalculationMode(const BetweennessCalculationMode &)
void ConvertCentralityMapToHistogram()
boost::graph_traits< NetworkType >::vertex_iterator IteratorType
void CalculateWeightedUndirectedBetweennessCentrality(NetworkType *, IteratorType, IteratorType)
int GetNumberOfVertices() const
static const char * CONNECTOMICS_ERROR_OUTSIDE_INTEGER_RANGE
BetweennessCalculationMode
virtual void ComputeFromConnectomicsNetwork(ConnectomicsNetwork *source) override
Creates a new histogram from the network source.
void CalculateUnweightedUndirectedBetweennessCentrality(NetworkType *, IteratorType, IteratorType)
static const char * CONNECTOMICS_WARNING_UNIMPLEMENTED_FEATURE
ConnectomicsBetweennessHistogram()
mitk::ConnectomicsNetwork::NetworkType NetworkType
BetweennessCalculationMode GetBetweennessCalculationMode()
Connectomics Network Class.
NetworkType * GetBoostGraph()
std::string m_Subject
Subject of the histogram as a string.