HistThresh toolbox - authored by Antti Niemistö