Detection of functional networks in the resting brain