Skip to main content
Ctrl+K

Anri v0.1.0

  • User guide
  • API reference
  • Contributing
  • Changelog
  • User guide
  • API reference
  • Contributing
  • Changelog

Section Navigation

  • crystal
    • B_matrix
    • B_to_rmt
    • UBI_to_mt
    • allowed_hkls
    • cubic_grid_misorientation
    • cubochoric_quaternions
    • disorientation
    • float64
    • lattice_parameters
    • laue_rotations
    • lpars_rlpars_to_B
    • lpars_to_B
    • lpars_to_mt
    • mat_to_quat
    • mat_to_rod
    • metric_to_volume
    • mt_to_lpars
    • mt_to_rmt
    • orientation_grid
    • quat_mul
    • quat_to_mat
    • reflections
    • rings
    • rmt_to_mt
    • rod_to_mat
    • space_group
    • structure_factors
    • symmetry_matrices
    • to_fundamental_zone
  • diffract
    • ds_to_tth
    • k_to_q_lab
    • omega_from_core
    • omega_solns
    • omega_solns_both
    • omega_solns_core
    • peak_lab_to_k_out
    • q_lab_to_k_out
    • q_lab_to_tth_eta
    • q_to_ds
    • scale_norm_k
    • tth_eta_to_k_out
  • geom
    • beam_basis
    • det_to_lab
    • detector_basis_vectors_lab
    • detector_orientation_matrix
    • detector_rotation_matrix
    • detector_transforms
    • dty_and_origin_lab
    • find_dty_for_beam_xy
    • lab_to_det
    • lab_to_sample
    • raytrace_to_det
    • recon_positions
    • recon_to_step
    • rmat_from_axis_angle
    • rot_x
    • rot_y
    • rot_z
    • sample_to_lab
    • sino_shift_and_pad
    • step_grid_from_ybincens
    • step_to_recon
    • step_to_sample
  • fwd
    • beam_weight
    • check_render
    • get_centroid_box
    • get_centroid_box_all
    • get_centroid_box_all_both
    • get_centroid_box_all_grains
    • get_centroid_box_all_grains_both
    • get_centroid_box_both
    • get_centroid_scan
    • get_centroid_scan_all
    • get_centroid_scan_all_both
    • get_centroid_scan_all_grains
    • get_centroid_scan_all_grains_both
    • get_centroid_scan_both
    • get_cov_in
    • guess_batch_size
    • hkl_to_k_omega
    • hkl_to_k_omega_both
    • lorentz
    • make_row
    • polarisation
    • propagate_cov
    • propagate_cov_box
    • propagate_cov_box_all
    • propagate_cov_box_all_grains
    • propagate_cov_scan
    • propagate_cov_scan_all
    • propagate_cov_scan_all_both
    • propagate_cov_scan_all_grains
    • propagate_cov_scan_all_grains_both
    • propagate_cov_scan_both
    • render_peaks
    • render_row
    • select_peaks
  • index
    • backproject
    • backward
    • beam_rows
    • block_voxels
    • candidates
    • candidates_from
    • censored_ratio
    • choose_grid
    • coarsen_rows
    • completeness
    • completeness_of
    • deviance
    • draw_mask
    • dty_offsets
    • fit_occupancy
    • forward
    • histogram
    • histogram_pixels
    • inherit_candidates
    • lit_table
    • lorentz_polarisation
    • match_tolerances
    • mlem
    • orientation_mlem
    • otsu
    • pad_voxels
    • pixel_angles
    • polygon_mask
    • populations
    • predict
    • predictions
    • prune
    • ramp_filter
    • reconstruct
    • ring_profile
    • ring_table
    • ring_widths
    • system
    • threshold_mask
    • tth_profile
  • io
    • beam_from_pars
    • detector_from_pars
    • entries_from_tensormap
    • geom_from_pars
    • gonio_from_pars
    • motor_grid
    • prefetch
    • read_dataset
    • read_frame_dty
    • read_monitor
    • read_par
    • read_pars_json
    • read_spatial
    • simulate_sparse
    • stream_sparse
    • tensormap_from_recon
    • write_dataset
    • write_par
    • write_pars
    • write_peaks_table
    • write_scan
    • write_zero_distortion
  • phantom
    • axis_angle
    • brownian_field
    • polycrystal
    • random_rotations
    • small_rotations
    • tensormap
    • voronoi
  • utils
    • inv3
    • mesh
    • setup
  • API reference
  • phantom
  • voronoi

voronoi#

anri.phantom.voronoi(xy, seeds)[source]#

Label points by their nearest seed.

Parameters:
  • xy (Array | ndarray | bool | number | bool | int | float | complex) – [N, 2] points

  • seeds (Array | ndarray | bool | number | bool | int | float | complex) – [M, 2] seed positions

Returns:

np.ndarray – [N] index of the nearest seed

previous

tensormap

next

utils

On this page
  • voronoi()
Show Source

© Copyright 2026, James A. D. Ball.

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.23.0.