WIP: Port threshold methods from ImageJ Common