You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing the Euler characteristic computation function, nipy.algorithms.statistics.intvol.EC2d, I found some unexpected behavior that could be reduced to the following :
In [2]: import numpy as np
In [3]: from nipy.algorithms.statistics.intvol import EC2d
In [4]: a = np.ones(shape=(3, 3), dtype='int'); print a, EC2d(a)
[[1 1 1]
[1 1 1]
[1 1 1]] -1
In [5]: a[0, 0] = 0; print a, EC2d(a)
[[0 1 1]
[1 1 1]
[1 1 1]] 1
In [6]: a[0, 0] = 1; a[-1, 0] = 0; print a, EC2d(a)
[[1 1 1]
[1 1 1]
[0 1 1]] -1
Is that a expected consequence of those functions being approximate? Thanks for your help and sorry if I am misunderstanding the intended purpose of the functions.
The text was updated successfully, but these errors were encountered:
I think this has to do with how a binary "image" is triangulated. It has been some time since I've looked at the code. If a is padded with 0s this problem is not there.
In [22]: a = np.ones(shape=(3, 3), dtype='int'); print a, EC2d(a)
[[1 1 1]
[1 1 1]
[1 1 1]] -1
While testing the Euler characteristic computation function,
nipy.algorithms.statistics.intvol.EC2d
, I found some unexpected behavior that could be reduced to the following :Is that a expected consequence of those functions being approximate? Thanks for your help and sorry if I am misunderstanding the intended purpose of the functions.
The text was updated successfully, but these errors were encountered: