ANTsPy
ANTsPy copied to clipboard
Hotfix 380
Adds warning when raised when a label interpolator is used with an image with a suspiciously high cardinality.
A potential problem: runtime
Counting unique voxels takes about 10s on a large image (1000 x 500 x 250), due to using the 'quick' and dirty method of len(np.unique(moving))
. The warning only needs a rough estimate of cardinality though. Runtime could be significantly improved using something like hyperloglog or calculating cardinality for a random sample of voxels.
I don't think the warning should include NearestNeighbor interpolation, as that's perfectly sensible to use with grayscale images and won't tie up the system for a long period anyway.
Multilabel should probably just be removed as its just an inferior version of GenericLabel anyways...