-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Labels
Description
Hello, first time using this lib, but I think a bug was introduced in the latest version from yesterday.
We have in the assd function in metric/binary.py:
assd = numpy.mean(
(
__surface_distances(result, reference, voxelspacing, connectivity),
__surface_distances(reference, result, voxelspacing, connectivity),
)
)
return assd
When the returning arrays are not of the same dim, numpy.mean crashes with the exception:
setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions.
A possible fix:
assd = numpy.mean(
(
np.concatenate([__surface_distances(result, reference, voxelspacing, connectivity),
__surface_distances(reference, result, voxelspacing, connectivity)])
)
)
return assd