-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
The calculation of the spatial moments is incorrect:
import nyxus
import numpy as np
outmask = np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
outmask
>>> array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
>>> [0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
>>> [0, 0, 0, 0, 0, 1, 1, 0, 0, 0],
>>> [0, 0, 0, 0, 1, 1, 1, 1, 0, 0],
>>> [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
>>> [0, 1, 1, 1, 1, 1, 1, 1, 1, 0],
>>> [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
>>> [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
>>> [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
>>> [0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
>>> [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
nyx = nyxus.Nyxus(["AREA_PIXELS_COUNT","SPAT_MOMENT_00"])
nyx.featurize(outmask,outmask)[["AREA_PIXELS_COUNT","SPAT_MOMENT_00"]]
>>> AREA_PIXELS_COUNT SPAT_MOMENT_00
>>> 0 43.0 0.0
Metadata
Metadata
Assignees
Labels
No labels