Support silx mask from silx 0.14
We have recently noticed that the mask created from silx can't be used in Lima without been inverted.
The convensions are not the same.
- Lima -> Mask = 0 -> Set data to 0
- Silx -> Mask != 0 -> Set data to 0
In the next next coming silx version 0.14, a tag was added to the mask file in order to know the application where the EDF comes from. See https://github.com/silx-kit/silx/pull/3310 In this case the EDF mask header will contain header["program_name"] == "silx-mask"
.
As result we are able to properly read the mask convention.
This PR
- Fix the EDF header propagation when using
Utils.getDataFromFile
.- Previously errors was inhibited, and the header setter was just not working.
- Create a
getMaskDataFromFile
- Read the EDF header to check existance of
masked_value
, and according to the following values, patch the mask data-
zero
: Mask the data when the mask value is 0 (default Lima convention) -
nonzero
: Mask the data when the mask value is something else than 0 (default silx convention)
-
See also https://github.com/silx-kit/silx/issues/3217
I expect this PR to provide a better integration of silx view
, Flint
and then BLISS
with Lima. See bliss/bliss!2987.
Edited by Valentin Valls