'Setup required before starting a phase.
This method makes \'state\' and \'sample\' point to the right variable depending
on the phase.'

def SetPhase(self, layer, pos=True):

    if pos:
        layer.state = layer.pos_state
        layer.sample = layer.pos_sample
    else:
        layer.state = layer.neg_state
        layer.sample = layer.neg_sample
