mlreco.visualization.gnn module

mlreco.visualization.gnn.scatter_clusters(voxels, labels, clusters, markersize=5, colorscale='Viridis')[source]

Scatter plot of cluster voxels colored by cluster order

Parameters
  • voxels (np.ndarray) – (N,3) List of voxel coordinate

  • labels (np.ndarray) –

    1. List of voxels labels

  • clusts ([np.ndarray]) –

    1. List of arrays of voxel IDs in each cluster

  • markersize (int) – Size of the voxel markersize

  • colorscale (str) – Plotly color scale name

Returns

Scatter plot

Return type

[plotly.graph_objs.Scatter3d]

mlreco.visualization.gnn.network_topology(voxels, clusters, edge_index=[], clust_labels=[], edge_labels=[], mode='scatter', markersize=3, linewidth=2, colorscale='Inferno', cmin=None, cmax=None, coords_col=(1, 4), **kwargs)[source]

Network 3D topological representation

Parameters
  • voxels (np.ndarray) – (N,3) List of voxel coordinate

  • clusts ([np.ndarray]) –

    1. List of arrays of voxel IDs in each cluster

  • edge_index (np.ndarray) – (E,2) List of connections

  • clust_labels (np.ndarray) –

    1. Cluster labels

  • edge_labels (np.ndarray) –

    1. Edge labels

  • mode (str) – Draw mode (‘sphere’, ‘cone’, ‘hull’, ‘scatter’)

  • markersize (int) – Size of the voxel markersize in pixels

  • linewidth (int) – Width of the edge lines in pixels

  • colorscale (str) – Plotly color scale name

Returns

  1. 3D Scatter plots of [nodes, edges]

Return type

[plotly.graph_objs.Scatter3d]

mlreco.visualization.gnn.network_schematic(clusters, edge_index, clust_labels=[], edge_labels=[], linewidth=1, colorscale='Inferno')[source]

Network 2D schematic representation

Parameters
  • clusts ([np.ndarray]) –

    1. List of arrays of voxel IDs in each cluster

  • edge_index (np.ndarray) – (E,2) List of connections

  • clust_labels (np.ndarray) –

    1. Node labels

  • edge_labels (np.ndarray) –

    1. Edge labels

  • linewidth (int) – Width of the edge lines in pixels

  • colorscale (str) – Plotly color scale name

Returns

  1. Scatter plots of [nodes, edges]

Return type

[plotly.graph_objs.Scatter]

mlreco.visualization.gnn.get_object_color(min, max, val, colorscale)[source]

Get color given the value of an object and a plotly colorscale (if multiple objects are drawn, their colors is arbitrary and does not follow the color value given to the object)

Parameters
  • min (double) – Minimum value of the range of values to be drawn

  • max (double) – Maxmimum value of the range of values to be drawn

  • val (double) – Value of the object

  • colorscale (string or list) – Plotly colorscale (either name of user defined list)

Returns

Plotly color

Return type

str