Closed jokasimr closed 9 months ago
We should also decide how to behave when one of the "undefined" bits is set? Should it raise? Save to mask an an integer dtype-mask (which won't work in operations)? Use the bit offset as mask name?
How do we determine which bits are in use? If it is set to 0 in the entire array?
There is a number of ways to do this. One could use min
and max
and test all the values in between. Or use group
with some fake values and the mask as a grouping coord. Or some NumPy function. Would need to test which is most performant for up to about 10 million pixels (though we should also try up to 100 million, I think).
Fixes #157.
~This is still a very rough draft.~ ~I need a nexus file with a pixel mask to experiment with.~
The transformation from bitmask to dictionary of masks is tested. But actually reading masks from a nexus file is still untested.