Visualization

Visualization functions for CORE registration results

core.visualization.visualization.create_detailed_nuclei_plot_with_colormaps(moving_df, fixed_df)[source]

Create detailed nuclei plot with color mapping by area

Parameters:
  • moving_df – Moving nuclei DataFrame

  • fixed_df – Fixed nuclei DataFrame

Returns:

Bokeh figure object

core.visualization.visualization.create_method_comparison_plot(fixed_df, moving_df, icp_registered_df, shape_aware_registered_df)[source]

Create comparison plot between ICP and Shape-Aware registration methods

Parameters:
  • fixed_df – Fixed nuclei DataFrame

  • moving_df – Original moving nuclei DataFrame

  • icp_registered_df – ICP registered moving nuclei DataFrame

  • shape_aware_registered_df – Shape-aware registered moving nuclei DataFrame

Returns:

Bokeh figure object

core.visualization.visualization.create_nuclei_overlay_plot(moving_df, fixed_df, title='Fixed vs Moving Nuclei Coordinates')[source]

Create interactive Bokeh plot for nuclei coordinates overlay

Parameters:
  • moving_df – DataFrame with moving nuclei coordinates

  • fixed_df – DataFrame with fixed nuclei coordinates

  • title – Plot title

Returns:

Bokeh figure object

core.visualization.visualization.create_registration_comparison_plot(fixed_df, moving_df, moving_rigid_df, moving_nonrigid_df=None)[source]

Create comparison plot showing original, rigid, and non-rigid registration

Parameters:
  • fixed_df – Fixed nuclei DataFrame

  • moving_df – Original moving nuclei DataFrame

  • moving_rigid_df – Rigid registered moving nuclei DataFrame

  • moving_nonrigid_df – Non-rigid registered moving nuclei DataFrame (optional)

Returns:

Bokeh figure object

core.visualization.visualization.setup_bokeh_notebook()[source]

Setup Bokeh for notebook output

core.visualization.visualization.show_plot(plot)[source]

Display a Bokeh plot

Parameters:

plot – Bokeh figure object

core.visualization.visualization.visualize_cluster_alignment(fixed_points, moving_points, moving_updated, fixed_df=None, moving_df=None, figsize=(10, 10), title='Cluster Centers: Fixed, Original Moving, and Transformed', save_path=None)[source]

Visualize and optionally save the alignment between fixed, moving, and transformed cluster centers.

Parameters:
  • fixed_points (np.ndarray) – Array of fixed cluster centers with shape (N, 2).

  • moving_points (np.ndarray) – Array of original moving cluster centers with shape (N, 2).

  • moving_updated (np.ndarray) – Array of transformed (aligned) moving cluster centers with shape (N, 2).

  • fixed_df (pandas.DataFrame, optional) – DataFrame to update with fixed point coordinates.

  • moving_df (pandas.DataFrame, optional) – DataFrame to update with moving point coordinates.

  • figsize (tuple, default=(10, 10)) – Figure size for the plot.

  • title (str, optional) – Title for the plot.

  • save_path (str, optional) – Path to save the plot (e.g., “results/alignment_plot.png”). If None, the plot is just shown.

Returns:

fixed_df, moving_df – Updated DataFrames if provided, else None.

Return type:

pandas.DataFrame or None

core.visualization.visualization.visualize_overlays(fixed_tile, moving_tile, transformed_tile)[source]
core.visualization.visualization.visualize_patches(fixed_tile, moving_tile, transformed_tile)[source]

Visualize fixed, moving, and transformed image patches

Parameters:
  • fixed_tile – Fixed image patch

  • moving_tile – Moving image patch

  • transformed_tile – Transformed image patch

core.visualization.visualization.visualize_shape_aware_registration(registrator_obj, title='Shape-Aware Point Set Registration')[source]

Visualize shape-aware registration results using the built-in method

Parameters:
  • registrator_obj – ShapeAwarePointSetRegistration object after registration

  • title – Plot title

Returns:

Bokeh figure object

core.visualization.visualization.visualize_transformed_image(transformed_image)[source]

Display transformed image using matplotlib

Parameters:

transformed_image – Transformed image array