Skip to content

Commit

Permalink
Add arg detection for overloading (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
asoplata authored Jul 15, 2024
1 parent 1a9e689 commit a99ba5e
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions atlas_placement_hints/compute_placement_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,23 @@ def compute_placement_hints(
least one distance-related problem.
See distances.distance_to_meshes.report_distance_problems doc.
"""
distances_info = atlas.compute_distances_to_layer_boundaries(
direction_vectors,
flip_direction_vectors=flip_direction_vectors,
has_hemispheres=has_hemispheres,
thalamus_meshes_dir=thalamus_meshes_dir,
)

if thalamus_meshes_dir == "":
# Use either the AbstractLayeredAtlas or VoxelBasedLayeredAtlas version if
# no meshes are provided
distances_info = atlas.compute_distances_to_layer_boundaries(
direction_vectors,
flip_direction_vectors=flip_direction_vectors,
has_hemispheres=has_hemispheres,
)
else:
# Use the MeshBasedLayeredAtlas version if meshes are provided
distances_info = atlas.compute_distances_to_layer_boundaries(
direction_vectors,
flip_direction_vectors=flip_direction_vectors,
has_hemispheres=has_hemispheres,
thalamus_meshes_dir=thalamus_meshes_dir,
)

distances_to_meshes = distances_info["distances_to_layer_boundaries"]
tolerance = 2.0 * atlas.region.voxel_dimensions[0]
Expand Down

0 comments on commit a99ba5e

Please sign in to comment.