fishdist.coordinate_utils
compute_registration_matrix(anterior_src, posterior_src, proximal_src, distal_src, anterior_target, posterior_target, proximal_target, distal_target, return_transformer=False)
Compute the registration matrix for alignment.
| Parameters: |
|
|---|
| Returns: |
|
|---|
convert_slices_to_set_of_coordinates(slices_list)
Converts a list of slices to a set of coordinates.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Examples:
Convert a list of slices to a set of coordinates:
>>> coordinates = convert_slices_to_set_of_coordinates(slices_list)
get_cuboid(image, centroid, cube_radius, return_cuboid_coords_instead=False, force_centroid_int=True)
Extracts a cuboid region from an image based on the centroid and cube radius.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Examples:
Extract a cuboid region from an image:
>>> cuboid = get_cuboid(image, centroid, cube_radius)
Extract the coordinates of a cuboid region:
>>> cuboid_coords = get_cuboid(image, centroid, cube_radius, return_cuboid_coords_instead=True)
make_point_in_bounds(point, bounds_array_as_n_and_2_dimensions_giving_min_and_max_of_each_dim)
Adjusts a point to be within the given bounds.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Examples:
Adjust a point to be within the bounds:
>>> new_point = make_point_in_bounds(point, bounds_array)
nd_slice_to_indexes(nd_slice)
Converts an n-dimensional slice to indices.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Examples:
Convert an n-dimensional slice to indices:
>>> indexes = nd_slice_to_indexes(nd_slice)
remove_out_of_bonds_coords(region_coords, bounds)
Removes coordinates that are outside of the given bounds.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Examples:
Remove coordinates outside of the bounds:
>>> new_coords = remove_out_of_bonds_coords(region_coords, bounds)
remove_out_of_bonds_coords_nd(region_coords, bounds_array_as_n_and_2_dimensions_giving_min_and_max_of_each_dim)
Removes coordinates that are outside of the given bounds.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Examples:
Remove coordinates outside of the bounds:
>>> new_coords = remove_out_of_bonds_coords_nd(region_coords, bounds_array)
remove_out_of_image_coords(region_coords, img)
Removes coordinates that are outside of the image bounds.
| Parameters: |
|
|---|
| Returns: |
|
|---|