DIST -> Visualize Point Clouds Handles

tardis_em.utils.visualize_pc.img_is_color(img)
tardis_em.utils.visualize_pc.show_image_list(list_images, list_titles=None, list_cmaps=None, list_mask_cmaps=None, grid=True, num_cols=2, figsize=(20, 10), title_fontsize=30, list_masks=None)

Shows a grid of images, where each image is a Numpy array. The images can be either RGB or grayscale.

Parameters:
  • list_images (list) – List of the images to be displayed.

  • list_titles (list or None) – Optional list of titles to be shown for each image.

  • list_cmaps (list, str or None) – Optional list of cmap values for each image. If None, then cmap will be automatically inferred.

  • list_mask_cmaps (list, str or None)

  • grid (boolean) – If True, show a grid over each image

  • num_cols (int) – Number of columns to show.

  • figsize (tuple) – Value to be passed to pyplot.figure()

  • title_fontsize (int) – Value to be passed to set_title()

  • list_masks (list, None)

tardis_em.utils.visualize_pc.segment_to_graph(coord: ndarray) list

Build filament vector lines for open3D.

Parameters:

coord (np.ndarray) – 2D or 3D array of shape [(s) x X x Y x Z] or [(s) x X x Y].

Returns:

list of segments converted for open3D

Return type:

list

tardis_em.utils.visualize_pc.VisualizePointCloud(coord: ndarray, segmented: bool, rgb: ndarray | None = None, animate=False)

Visualized point cloud.

Output color coded point cloud. Color values indicate individual segments.

Parameters:
  • coord (np.ndarray) – 2D or 3D array of shape [(s) x X x Y x Z] or [(s) x X x Y].

  • segmented (bool) – If True expect (s) in a data format as segmented values.

  • rgb (np.ndarray) – Optional, indicate rgb values.

  • animate (bool) – Optional trigger to turn off animated rotation.

tardis_em.utils.visualize_pc.rotate_view(vis)

Optional viewing parameter for open3D to constantly rotate scene. :param vis: Open3D view control setting.

tardis_em.utils.visualize_pc.background_view(vis)

Optional viewing parameter for open3D to constantly rotate scene. :param vis: Open3D view control setting.

tardis_em.utils.visualize_pc.VisualizeFilaments(coord: ndarray, animate=True, with_node=True)

Visualized filaments.

Output color coded point cloud. Color values indicate individual segments.

Parameters:
  • coord (np.ndarray) – 2D or 3D array of shape [(s) x X x Y x Z] or [(s) x X x Y].

  • animate (bool) – Optional trigger to turn off animated rotation.

  • with_node (bool) – Optional, If True show points on filament

tardis_em.utils.visualize_pc.VisualizeScanNet(coord: ndarray, segmented: True)

Visualized scannet scene

Output color-coded point cloud. Color values indicate individual segments.

Parameters:
  • coord (np.ndarray) – 2D or 3D array of shape [(s) x X x Y x Z] or [(s) x X x Y].

  • segmented (bool) – If True expect (s) in a data format as segmented values.