Hi all,
I would need an automatic way of running Foreground Masking via command line.
As far as I understood it is not a cli module, so I need to load the image and run the mask generation via a python script.
However, I didn’t find a way for accessing its logic.
If volume geometries are matching then you can also do masking (or combine volumes with various functions) using standard numpy array operations. See this example in the script repository.
Otsu (and about 6-8 other) automatic threshold computation methods are available in Threshold effect and morphological opening is available in Smoothing effect in Segment Editor. You can use these effects from Python as shown in examples in the script repository.