diff --git a/examples/labels/plot_path_maps.py b/examples/labels/plot_path_maps.py index cf80e37..037af85 100644 --- a/examples/labels/plot_path_maps.py +++ b/examples/labels/plot_path_maps.py @@ -73,6 +73,9 @@ ps = [a.get_particle() for a in IMP.atom.get_leaves(hier)] path_map.set_particles(ps) path_map.sample_obstacles(extra_radius=0.0) +# The origin is located on an atom and hence blocked. Thus, there cannot be +# a path to the origin. Hence, unblock sphere around the origin. +path_map.fill_sphere(path_origin, radius=3.0, value=0.0, inverse=False) path_map.update_tiles() # %% @@ -92,7 +95,7 @@ path_map.find_path_dijkstra(start_idx, -1) # if the end_idx # %% # Now, we can backtrace the shortest path from every tile (voxel) to the -# start index. A path is a squence of tile/voxel ids. +# start index. A path is a sequence of tile/voxel ids. t = path_map.get_tiles() end_idx_1 = 829 path_1 = t[end_idx_1].backtrack_to_path() @@ -102,6 +105,7 @@ path_2 = t[end_idx_2].backtrack_to_path() print(path_2) + # %% # Not to all tiles a path can be found. A tile without a path to the # starting tile has a path-length of 1. diff --git a/examples/labels/plot_search.py b/examples/labels/plot_search.py index bdc61de..8a46068 100644 --- a/examples/labels/plot_search.py +++ b/examples/labels/plot_search.py @@ -44,9 +44,13 @@ # The PathMapHeader defines the grid spacing and the size of the grid used # in the path search. The grid will have an edge that has twice the maximum # path length. -max_path_length = 20.0 -grid_spacing = 1.0 -path_map_header = IMP.bff.PathMapHeader(max_path_length, grid_spacing) +path_map_header_parameter = { + "max_path_length": 20.0, + "grid_spacing": 1.0, + "neighbor_radius": 2, + "obstacle_threshold": 1e-5 +} +path_map_header = IMP.bff.PathMapHeader(**path_map_header_parameter) path_map_header.set_path_origin(path_origin) # %% diff --git a/examples/release_highlights/plot_release_highlights_0_12_0.py b/examples/release_highlights/plot_release_highlights_0_12_0.py index a9a0044..f27ccea 100644 --- a/examples/release_highlights/plot_release_highlights_0_12_0.py +++ b/examples/release_highlights/plot_release_highlights_0_12_0.py @@ -60,6 +60,9 @@ ps = [a.get_particle() for a in IMP.atom.get_leaves(hier)] path_map.set_particles(ps) path_map.sample_obstacles(extra_radius=0.0) +# The origin is located on an atom and hence blocked. Thus, there cannot be +# a path to the origin. Hence, unblock sphere around the origin. +path_map.fill_sphere(path_origin, radius=3.0, value=0.0, inverse=False) path_map.update_tiles() start_idx = path_map.get_voxel_by_location(path_origin) path_map.find_path_dijkstra(start_idx, -1) # if the end_idx @@ -67,6 +70,7 @@ t = path_map.get_tiles() end_idx_1 = 829 path_1 = t[end_idx_1].backtrack_to_path() +print(path_1) end_idx_2 = 229 path_2 = t[end_idx_2].backtrack_to_path()