Sequence-independent segmentation of magnetic resonance images