Design and test of readout electronics for medical and astrophysics applications