Medipix toggeling routine