Use of functional habitats to link ecology with morphology and hydrology in river rehabilitation.