Skip to content

find_closest_streamline accepts resolution but does not use it to voxelise #23

Description

@gouwens

angle.find_closest_streamline takes a resolution argument and uses it to scale the coordinates it returns:

streamline_coords = streamline_coords * np.array(resolution)

but converts the input coordinate with the default:

voxel = np.squeeze(coordinates_to_voxels(coord))   # resolution not forwarded

So at any resolution other than (10, 10, 10) the wrong voxel is looked up. At (20, 20, 20) a coordinate is voxelised against a grid twice as fine as intended, landing on a voxel that is usually outside the lookup — in which case the function logs "Requested voxel is not within isocortex and has no defined closest streamline" and returns an empty array for a point that is squarely inside cortex.

The fix is presumably coordinates_to_voxels(coord, resolution=resolution).

Pinned by tests/test_angle.py::test_resolution_is_honoured_when_finding_the_streamline in #18.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions