|
161 | 161 | %% INTERPOLATION |
162 | 162 |
|
163 | 163 | % get interpolation windows for average and individual eye signals |
164 | | -fprintf('Searching for valid interpolation windows\n'); |
165 | 164 | interpwins = findInterpWins(xpos, ypos, missing,par.windowtimeInterp,par.edgeSampInterp,par.freq,par.maxdisp); |
166 | 165 | if q2Eyes |
167 | 166 | llinterpwins = findInterpWins(data.left.X ,data.left.Y ,llmiss ,par.windowtimeInterp,par.edgeSampInterp,par.freq,par.maxdisp); |
168 | 167 | rrinterpwins = findInterpWins(data.right.X ,data.right.Y ,rrmiss ,par.windowtimeInterp,par.edgeSampInterp,par.freq,par.maxdisp); |
169 | 168 | end |
170 | 169 |
|
171 | 170 | % Use Steffen interpolation and replace values |
172 | | -fprintf('Replace interpolation windows with Steffen interpolation\n'); |
173 | 171 | [xpos,ypos,missingn]= windowedInterpolate(xpos, ypos, missing, interpwins,par.edgeSampInterp); |
174 | 172 | if q2Eyes |
175 | 173 | [llx ,lly ,llmiss] = windowedInterpolate(data.left.X ,data.left.Y ,llmiss ,llinterpwins,par.edgeSampInterp); |
|
181 | 179 | %% CALCULATE 2-MEANS CLUSTERING FOR SINGLE EYE |
182 | 180 |
|
183 | 181 | % get kmeans-clustering for averaged signal |
184 | | - fprintf('2-Means clustering started for averaged signal \n'); |
185 | 182 | [data.finalweights,stopped] = twoClusterWeighting(xpos,ypos,missingn,par.downsamples,par.downsampFilter,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
186 | 183 |
|
187 | 184 | % check whether clustering succeeded |
188 | 185 | if stopped |
189 | | - fprintf('Clustering stopped after exceeding max errors, continuing to next file \n'); |
| 186 | + fprintf('Clustering stopped after exceeding max errors\n'); |
190 | 187 | return |
191 | 188 | end |
192 | 189 |
|
193 | | - %% CALCULATE 2-MEANS CLUSTERING FOR SEPARATE EYES |
194 | 190 | elseif q2Eyes |
| 191 | + %% CALCULATE 2-MEANS CLUSTERING FOR SEPARATE EYES |
195 | 192 | % get kmeans-clustering for left eye signal |
196 | | - fprintf('2-Means clustering started for left eye signal \n'); |
197 | 193 | [finalweights_left,stopped] = twoClusterWeighting(llx,lly,llmiss,par.downsamples,par.downsampFilter,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
198 | 194 |
|
199 | 195 | % check whether clustering succeeded |
200 | 196 | if stopped |
201 | | - fprintf('Clustering stopped after exceeding max errors, continuing to next file \n'); |
| 197 | + fprintf('Clustering stopped after exceeding max errors\n'); |
202 | 198 | return |
203 | 199 | end |
204 | 200 |
|
205 | 201 | % get kmeans-clustering for right eye signal |
206 | | - fprintf('2-Means clustering started for right eye signal \n'); |
207 | 202 | [finalweights_right,stopped] = twoClusterWeighting(rrx,rry,rrmiss,par.downsamples,par.downsampFilter,par.chebyOrder,par.windowtime,par.steptime,par.freq,par.maxerrors); |
208 | 203 |
|
209 | 204 | % check whether clustering succeeded |
210 | 205 | if stopped |
211 | | - fprintf('Clustering stopped after exceeding max errors, continuing to next file \n'); |
| 206 | + fprintf('Clustering stopped after exceeding max errors\n'); |
212 | 207 | return |
213 | 208 | end |
214 | 209 |
|
|
217 | 212 | end |
218 | 213 |
|
219 | 214 | %% DETERMINE FIXATIONS BASED ON FINALWEIGHTS_AVG |
220 | | -fprintf('Determining fixations based on clustering weight mean for averaged signal and separate eyes + 2*std \n') |
221 | 215 | [fix.cutoff,fix.start,fix.end,fix.startT,fix.endT,fix.dur,fix.xpos,fix.ypos,fix.flankdataloss,fix.fracinterped] = getFixations(data.finalweights,data.time,xpos,ypos,missing,par.cutoffstd,par.onoffsetThresh,par.maxMergeDist,par.maxMergeTime,par.minFixDur); |
222 | 216 | [fix.RMSxy,fix.BCEA,fix.fixRangeX,fix.fixRangeY] = getFixStats(xpos,ypos,missing,fix.start,fix.end,pixperdeg); |
0 commit comments