def get_brain_mask(): brain_mask_path = dp.get_brain_mask_path() if not exists(brain_mask_path): data = np.load(dp.get_concatenated_path(1)) mean_vol = np.mean(data, axis=-1) in_brain_mask = mean_vol > 150 np.save(brain_mask_path, in_brain_mask) return np.load(brain_mask_path)
def get_brain_mask(): """ Retrieves the path to the brain mask and loads that data Parameters ---------- None Returns ------- brain_mask : array """ brain_mask_path = dp.get_brain_mask_path() if not exists(brain_mask_path): data = np.load(dp.get_concatenated_path(1)) mean_vol = np.mean(data, axis=-1) in_brain_mask = mean_vol > 150 np.save(brain_mask_path, in_brain_mask) return np.load(brain_mask_path)