def get_mask(self, subject, xfmname, type='thick'):
        try:
            self.auxfile.get_mask(subject, xfmname, type)
        except (AttributeError, IOError):
            pass

        fname = self.get_paths(subject)['masks'].format(xfmname=xfmname, type=type)
        try:
            import nibabel
            nib = nibabel.load(fname)
            return nib.get_data().T != 0
        except __HOLE__:
            print('Mask not found, generating...')
            from .utils import get_cortical_mask
            mask = get_cortical_mask(subject, xfmname, type)
            self.save_mask(subject, xfmname, type, mask)
            return mask
dataset/ETHPy150Open gallantlab/pycortex/cortex/database.py/Database.get_mask