def __init__(self, log_path): self.log_dict = ft.loadFile(log_path) if not self.log_dict['presentation']['is_by_index']: raise NotImplementedError('The visual stimuli display should be indexed.') self.check_integrity()
['patch07', 'MMA'], ['patch08', 'MMP'], ['patch09', 'LLA'], # ['patch10', 'AM'], # ['patch11', 'LLA'], # ['patch12', 'MMP'], # ['patch13', 'MMP'] # ['patch14', 'MMP'] ] currFolder = os.path.dirname(os.path.realpath(__file__)) os.chdir(currFolder) trialPath = os.path.join(currFolder,trialName) trialDict = ft.loadFile(trialPath) finalPatches = dict(trialDict['finalPatches']) for i, namePair in enumerate(names): currPatch = finalPatches.pop(namePair[0]) newPatchDict = {namePair[1]:currPatch} finalPatches.update(newPatchDict) trialDict.update({'finalPatchesMarked':finalPatches}) ft.saveFile(trialPath,trialDict) trial, _ = rm.loadTrial(trialPath) f = plt.figure(figsize=(10,10)) ax = f.add_subplot(111)