'Read the file.'

@on_trait_change('file')
def read_file(self):

    if op.exists(self.file):
        if self.file.endswith('.fif'):
            bem = read_bem_surfaces(self.file, verbose=False)[0]
            self.points = bem['rr']
            self.norms = bem['nn']
            self.tris = bem['tris']
        else:
            try:
                (points, tris) = read_surface(self.file)
                points /= 1000.0
                self.points = points
                self.norms = []
                self.tris = tris
            except Exception:
                error(message='Error    loading    surface    from    %s    (see    Terminal    for    details).', title='Error    Loading    Surface')
                self.reset_traits(['file'])
                raise
    else:
        self.points = np.empty((0, 3))
        self.norms = np.empty((0, 3))
        self.tris = np.empty((0, 3))
