PlanktoScope / device-backend

All backend software underneath the PlanktoScope device's standard API
GNU General Public License v3.0
2 stars 6 forks source link

Only subtract consecutive masks when an env var is set #32

Closed ethanjli closed 6 months ago

ethanjli commented 6 months ago

This PR implements a requirement which @tpollina added to the v2024.0.0 milestone as a breaking change to make for the v2024.0.0-beta.0 prerelease (refer to the 2024-04-11 software meeting for context) to the behavior of the segmenter, so that by default it will no longer subtract consecutive masks from each other in the frame-processing pipeline.

Following a suggestion by @W7CH , I have made it possible for users to re-enable the behavior which this PR changes to be disabled by default - specifically, the segmenter now checks to see if the environment variable SEGMENTER_PIPELINE_SUBTRACT_CONSECUTIVE_MASKS is set to true, and if so, then the segmenter will perform subtraction between consecutive masks. If the environment variable is not set, the segmenter will follow the new default behavior (no subtraction). This environment variable will be controllable by the Forklift package core/apps/planktoscope/device-backend/processing/segmenter as a feature flag (in https://github.com/PlanktoScope/device-pkgs/pull/10).