Hi all,
In the function _get_searchlight_neighbors , in searchlight.py, edge voxels are excluded from spheres by using exclusive less than. This means that for small spheres, fewer voxels are selected than you might intuitively expect. For a mask with a radius of 1, for example, only the centre voxel is included. For a radius of 2, this means choosing 27 instead of 33.
This might not be a big practical issue, but seems somewhat unintuitive.
To solve, I suggest changing these lines
x = x[abs(x - cx) < radius]
y = y[abs(y - cy) < radius]
z = z[abs(z - cz) < radius]
return tuple(data[distance <radius].T.tolist())
To the following:
x = x[abs(x - cx) <= radius]
y = y[abs(y - cy) <= radius]
z = z[abs(z - cz) <= radius]
return tuple(data[distance <=radius].T.tolist())
best wishes,
Alex
Hi all,
In the function _get_searchlight_neighbors , in searchlight.py, edge voxels are excluded from spheres by using exclusive less than. This means that for small spheres, fewer voxels are selected than you might intuitively expect. For a mask with a radius of 1, for example, only the centre voxel is included. For a radius of 2, this means choosing 27 instead of 33.
This might not be a big practical issue, but seems somewhat unintuitive.
To solve, I suggest changing these lines
return tuple(data[distance <radius].T.tolist())To the following:
return tuple(data[distance <=radius].T.tolist())best wishes,
Alex