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.
angle.find_closest_streamlinetakes aresolutionargument and uses it to scale the coordinates it returns:but converts the input coordinate with the default:
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_streamlinein #18.