Is it possible to exclude 0 and 1 pixels from PJSR Image.mean() and PixelMath's mean() functions and others too?
Sure. Use the following properties:
Number Image.rangeClipHigh
Number Image.rangeClipLow
Boolean Image.rangeClippingEnabledto define range clipping bounds and enable/disable range clipping for a particular image.
As for PixelMath, the next version distributed with core version 1.8.3 comes with a special symbol initialization function that allows you to access view properties such as Mean, Median, StdDev, MAD, etc, in both clipped and unclipped versions. As of version 1.8.2, only clipped statistics are available through the mean($T), median($T), etc.