Generalised stochastic blockmodels and their applications in the analysis of brain networks