Dynamic connectivity among cortical layers in local and large-scale sensory processing