Package sc.fiji.snt.analysis.graph
Class GraphColorMapper<V,E extends org.jgrapht.graph.DefaultWeightedEdge>
java.lang.Object
sc.fiji.snt.analysis.ColorMapper
sc.fiji.snt.analysis.graph.GraphColorMapper<V,E>
- Type Parameters:
V- the vertex typeE- the edge type, must extendDefaultWeightedEdge
public class GraphColorMapper<V,E extends org.jgrapht.graph.DefaultWeightedEdge>
extends ColorMapper
A color mapping utility for graph visualization that assigns colors to vertices and edges
based on various graph metrics. This class supports multiple mapping strategies and
color schemes for graph visualization.
The mapper supports the following metrics:
BETWEENNESS_CENTRALITY- Colors vertices based on their betweenness centralityECCENTRICITY- Maps colors based on vertex eccentricityCONNECTIVITY- Colors components based on connectivityEDGE_WEIGHT- Maps colors based on edge weightsPAGE_RANK- Colors vertices based on PageRank algorithmIN_DEGREE- Maps colors based on vertex in-degreeOUT_DEGREE- Maps colors based on vertex out-degreeINCOMING_WEIGHT- Colors based on sum of incoming edge weightsOUTGOING_WEIGHT- Colors based on sum of outgoing edge weightsHEAVY_PATH_DECOMPOSITION- Colors edges based on heavy path decomposition
The mapping can be applied to:
- Vertices only (
VERTICES) - Edges only (
EDGES) - Both vertices and edges (
VERTICES_AND_EDGES)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFlag for "Betweenness centrality" mapping.static final StringFlag for "Connected components" mapping.static final StringFlag for "Eccentricity" mapping.static final StringFlag for "Edge weight" mapping.static final intstatic final StringFlag for "Heavy path decomposition" mapping.static final StringFlag for "In degree" mapping.static final StringFlag for "Incoming weight" mapping.static final StringFlag for "Out degree" mapping.static final StringFlag for "Outgoing weight" mapping.static final StringFlag for "Page rank" mapping.static final intstatic final intFields inherited from class sc.fiji.snt.analysis.ColorMapper
colorTable, integerScale, luts, lutService, max, min -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the available LUTs.net.imglib2.display.ColorTablegetColorTable(String lut) Gets the list of supported mapping metrics.intintintmap(SNTGraph<V, E> graph, org.jgrapht.graph.AsSubgraph<V, E> subgraph, String measurement, net.imglib2.display.ColorTable colorTable) protected voidmapToBetweennessCentrality(net.imglib2.display.ColorTable colorTable) protected voidmapToConnectivity(net.imglib2.display.ColorTable colorTable) protected voidmapToEccentricity(net.imglib2.display.ColorTable colorTable) protected voidmapToEdgeWeight(net.imglib2.display.ColorTable colorTable) protected voidmapToHeavyPathDecomposition(net.imglib2.display.ColorTable colorTable) protected voidmapToIncomingWeight(net.imglib2.display.ColorTable colorTable) protected voidmapToInDegree(net.imglib2.display.ColorTable colorTable) protected voidmapToOutDegree(net.imglib2.display.ColorTable colorTable) protected voidmapToOutgoingWeight(net.imglib2.display.ColorTable colorTable) protected voidmapToPageRank(net.imglib2.display.ColorTable colorTable) protected voidmapToProperty(String measurement, net.imglib2.display.ColorTable colorTable) voidvoidsetLegend(GraphEditor editor) voidsetMinMax(double min, double max) Sets the LUT mapping bounds.Methods inherited from class sc.fiji.snt.analysis.ColorMapper
getColor, getColorRGB, getColorTable, getMinMax, getNaNColor, initLuts, isIntegerScale, map, setNaNColor, unMap, unMap
-
Field Details
-
BETWEENNESS_CENTRALITY
Flag for "Betweenness centrality" mapping.- See Also:
-
ECCENTRICITY
Flag for "Eccentricity" mapping.- See Also:
-
CONNECTIVITY
Flag for "Connected components" mapping.- See Also:
-
EDGE_WEIGHT
Flag for "Edge weight" mapping.- See Also:
-
PAGE_RANK
Flag for "Page rank" mapping.- See Also:
-
IN_DEGREE
Flag for "In degree" mapping.- See Also:
-
OUT_DEGREE
Flag for "Out degree" mapping.- See Also:
-
INCOMING_WEIGHT
Flag for "Incoming weight" mapping.- See Also:
-
OUTGOING_WEIGHT
Flag for "Outgoing weight" mapping.- See Also:
-
HEAVY_PATH_DECOMPOSITION
Flag for "Heavy path decomposition" mapping.- See Also:
-
VERTICES
public static final int VERTICES- See Also:
-
EDGES
public static final int EDGES- See Also:
-
VERTICES_AND_EDGES
public static final int VERTICES_AND_EDGES- See Also:
-
graph
-
subgraph
-
-
Constructor Details
-
GraphColorMapper
public GraphColorMapper(org.scijava.Context context) -
GraphColorMapper
public GraphColorMapper()
-
-
Method Details
-
getMetrics
Gets the list of supported mapping metrics.- Returns:
- the list of mapping metrics.
-
getAvailableLuts
Gets the available LUTs.- Returns:
- the set of keys, corresponding to the set of LUTs available
-
getColorTable
-
map
-
map
-
map
-
mapToProperty
-
mapToConnectivity
protected void mapToConnectivity(net.imglib2.display.ColorTable colorTable) -
mapToEdgeWeight
protected void mapToEdgeWeight(net.imglib2.display.ColorTable colorTable) -
mapToBetweennessCentrality
protected void mapToBetweennessCentrality(net.imglib2.display.ColorTable colorTable) -
mapToEccentricity
protected void mapToEccentricity(net.imglib2.display.ColorTable colorTable) -
mapToPageRank
protected void mapToPageRank(net.imglib2.display.ColorTable colorTable) -
mapToInDegree
protected void mapToInDegree(net.imglib2.display.ColorTable colorTable) -
mapToOutDegree
protected void mapToOutDegree(net.imglib2.display.ColorTable colorTable) -
mapToIncomingWeight
protected void mapToIncomingWeight(net.imglib2.display.ColorTable colorTable) -
mapToOutgoingWeight
protected void mapToOutgoingWeight(net.imglib2.display.ColorTable colorTable) -
mapToHeavyPathDecomposition
protected void mapToHeavyPathDecomposition(net.imglib2.display.ColorTable colorTable) -
setMinMax
public void setMinMax(double min, double max) Description copied from class:ColorMapperSets the LUT mapping bounds.- Overrides:
setMinMaxin classColorMapper- Parameters:
min- the mapping lower bound (i.e., the highest measurement value for the LUT scale). It is automatically calculated (the default) when set to Double.NaNmax- the mapping upper bound (i.e., the highest measurement value for the LUT scale).It is automatically calculated (the default) when set to Double.NaN.
-
resetMinMax
public void resetMinMax() -
setLegend
-