The development of in vivo imaging and optogenetic tools makes it possible to control neural circuit activities in an all-optical, closed-loop manner, but such applications are limited by the lack of ...