Framework to study brain connectivity in living organisms