memory improvement by changing mask

when the mask was generated, by default it was float64, now it is
defined at boolean
Improvement in threshold finder
the threshold finder uses numpy operators and works directly on the mask, rather than generating new copies