def extrackEyetrackFeatures(self,basicEye): self.getUserInfo() files = os.listdir(self.curEyetrackDataFolder) featureSet = [] index = 0 for file in files: print index,file index = index+1 if os.path.splitext(file)[1] == ".csv": curRecord = [] splitresult = file.split('_') if len(splitresult) == 4: imgName = splitresult[3][:-4]+'.jpg' userName = splitresult[2] else: imgName = splitresult[4][:-4]+'.jpg' userName = splitresult[2]+'_'+splitresult[3] curRecord.append(imgName) if basicEye == 'left' or basicEye == 'right': curfile = self.curEyetrackDataFolder+'/'+file elif basicEye == 'main' or basicEye == 'nomain': print "Please Modify the folder for your eyetracker data" if self.userInfo[userName] == -1:#-1 means you choose the main eye and 1 means you choose the Auxiliary eye curfile = "Your left eye folder"+'/'+file else: curfile = "Your right eye folder"+file else: print "Wrong choosed for the basic eye!"; return curEyetrackDataProcessor = EyetrackerData(curfile) curEyetrackFeatures = curEyetrackDataProcessor.getFixationFeatures() curRecord.extend(curEyetrackFeatures) featureSet.append(curRecord) print curRecord self.eyetrackDataFeature = np.array(featureSet)
def getDisparityAngularFile(self,disparityfilesavepath): files = os.listdir(self.curEyetrackDataFolder) featureSet = [] index = 0 for file in files: print index,file index = index+1 if os.path.splitext(file)[1] == ".csv": curfile = self.curEyetrackDataFolder+'/'+file curEyetrackDataProcessor = EyetrackerData(curfile) curEyetrackDataProcessor.getDisparityAngularFile(disparityfilesavepath)
def getDisparityAngularFile(self, disparityfilesavepath): files = os.listdir(self.curEyetrackDataFolder) featureSet = [] index = 0 for file in files: print index, file index = index + 1 if os.path.splitext(file)[1] == ".csv": curfile = self.curEyetrackDataFolder + '/' + file curEyetrackDataProcessor = EyetrackerData(curfile) curEyetrackDataProcessor.getDisparityAngularFile( disparityfilesavepath)
def extrackEyetrackFeatures(self, basicEye): self.getUserInfo() files = os.listdir(self.curEyetrackDataFolder) featureSet = [] index = 0 for file in files: print index, file index = index + 1 if os.path.splitext(file)[1] == ".csv": curRecord = [] splitresult = file.split('_') if len(splitresult) == 4: imgName = splitresult[3][:-4] + '.jpg' userName = splitresult[2] else: imgName = splitresult[4][:-4] + '.jpg' userName = splitresult[2] + '_' + splitresult[3] curRecord.append(imgName) if basicEye == 'left' or basicEye == 'right': curfile = self.curEyetrackDataFolder + '/' + file elif basicEye == 'main' or basicEye == 'nomain': print "Please Modify the folder for your eyetracker data" if self.userInfo[ userName] == -1: #-1 means you choose the main eye and 1 means you choose the Auxiliary eye curfile = "Your left eye folder" + '/' + file else: curfile = "Your right eye folder" + file else: print "Wrong choosed for the basic eye!" return curEyetrackDataProcessor = EyetrackerData(curfile) curEyetrackFeatures = curEyetrackDataProcessor.getFixationFeatures( ) curRecord.extend(curEyetrackFeatures) featureSet.append(curRecord) print curRecord self.eyetrackDataFeature = np.array(featureSet)