Optimized software for a compact gamma camera