Skip to content

Commit fa97780

Browse files
committed
whitespace fix
1 parent 68d5b8b commit fa97780

1 file changed

Lines changed: 26 additions & 35 deletions

File tree

SharpEyes/ViewModels/StimulusGazeViewModel.cs

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public bool IsMovingGaze
3939
// Gaze overlay info
4040
internal NDArray? RawGazeLocations = null;
4141
internal NDArray? FilteredGazeLocations = null;
42-
internal NDArray? DisplayedGazeLocations => _isGazeFilterEnabled && ((object)FilteredGazeLocations != null) ? FilteredGazeLocations : RawGazeLocations;
42+
43+
internal NDArray? DisplayedGazeLocations => _isGazeFilterEnabled && ((object)FilteredGazeLocations != null)
44+
? FilteredGazeLocations
45+
: RawGazeLocations;
4346

4447
protected override NDArray? GazeData => DisplayedGazeLocations;
4548

@@ -81,7 +84,9 @@ private int? dataEndFrame
8184
}
8285
}
8386

84-
private ObservableCollection<VideoKeyFrame> _videoKeyFrames = new ObservableCollection<VideoKeyFrame>(new List<VideoKeyFrame>());
87+
private ObservableCollection<VideoKeyFrame> _videoKeyFrames =
88+
new ObservableCollection<VideoKeyFrame>(new List<VideoKeyFrame>());
89+
8590
public ObservableCollection<VideoKeyFrame> VideoKeyFrames
8691
{
8792
get;
@@ -97,6 +102,7 @@ public bool SetDefaultKeyFrames
97102

98103
// Gaze filtering
99104
private bool _isGazeFilterEnabled = Settings.Current.GazeFilterEnabled;
105+
100106
public bool IsGazeFilterEnabled
101107
{
102108
get => _isGazeFilterEnabled;
@@ -111,6 +117,7 @@ public bool IsGazeFilterEnabled
111117
}
112118

113119
private int _filterWindowSize = Settings.Current.GazeFilterWindowSize;
120+
114121
public int FilterWindowSize
115122
{
116123
get => _filterWindowSize;
@@ -123,6 +130,7 @@ public int FilterWindowSize
123130
}
124131

125132
private bool _filterPupilSize = Settings.Current.GazeFilterPupilSize;
133+
126134
public bool FilterPupilSize
127135
{
128136
get => _filterPupilSize;
@@ -136,6 +144,7 @@ public bool FilterPupilSize
136144
}
137145

138146
private bool _enableOutlierRemoval = Settings.Current.GazeFilterEnableOutlierRemoval;
147+
139148
public bool EnableOutlierRemoval
140149
{
141150
get => _enableOutlierRemoval;
@@ -149,6 +158,7 @@ public bool EnableOutlierRemoval
149158
}
150159

151160
private double _outlierThresholdX = Settings.Current.GazeFilterOutlierThresholdX;
161+
152162
public double OutlierThresholdX
153163
{
154164
get => _outlierThresholdX;
@@ -161,6 +171,7 @@ public double OutlierThresholdX
161171
}
162172

163173
private double _outlierThresholdY = Settings.Current.GazeFilterOutlierThresholdY;
174+
164175
public double OutlierThresholdY
165176
{
166177
get => _outlierThresholdY;
@@ -173,6 +184,7 @@ public double OutlierThresholdY
173184
}
174185

175186
private double _outlierThresholdRadius = Settings.Current.GazeFilterOutlierThresholdRadius;
187+
176188
public double OutlierThresholdRadius
177189
{
178190
get => _outlierThresholdRadius;
@@ -302,6 +314,7 @@ public void UpdateGaze()
302314
RawGazeLocations[i, 1] += multiplier * deltaY;
303315
}
304316
}
317+
305318
// update all following data frames with this delta
306319
RawGazeLocations[new Slice(dataFrame.Value, null), 0] += deltaX;
307320
RawGazeLocations[new Slice(dataFrame.Value, null), 1] += deltaY;
@@ -329,8 +342,9 @@ public void AddKeyFrame(int frame)
329342
}
330343

331344
VideoKeyFrames.Add(new VideoKeyFrame(frame, index, videoReader.FramesToTimecode(frame),
332-
RawGazeLocations[index, 0], RawGazeLocations[index, 1]));
333-
VideoKeyFrames = new ObservableCollection<VideoKeyFrame>(VideoKeyFrames.OrderBy((keyframe) => keyframe.VideoFrame));
345+
RawGazeLocations[index, 0], RawGazeLocations[index, 1]));
346+
VideoKeyFrames =
347+
new ObservableCollection<VideoKeyFrame>(VideoKeyFrames.OrderBy((keyframe) => keyframe.VideoFrame));
334348
}
335349
}
336350

@@ -343,6 +357,7 @@ private int? PreviousVideoKeyFrame
343357
if (VideoKeyFrames[i] < CurrentVideoFrame)
344358
return VideoKeyFrames[i].VideoFrame;
345359
}
360+
346361
return null;
347362
}
348363
}
@@ -367,6 +382,7 @@ private int? NextVideoKeyFrame
367382
if (VideoKeyFrames[i] > CurrentVideoFrame)
368383
return VideoKeyFrames[i].VideoFrame;
369384
}
385+
370386
return null;
371387
}
372388
}
@@ -434,8 +450,9 @@ public void SetCurrentAsDataStart()
434450
VideoKeyFrames.Clear();
435451
if (SetDefaultKeyFrames)
436452
{
437-
AddKeyFrame(dataStartFrame.Value); // start of data
438-
AddKeyFrame(dataStartFrame.Value + videoReader.fps * 37 * 2); // end of eyetracking calibration in driving
453+
AddKeyFrame(dataStartFrame.Value); // start of data
454+
AddKeyFrame(dataStartFrame.Value +
455+
videoReader.fps * 37 * 2); // end of eyetracking calibration in driving
439456
if (dataEndFrame >= videoReader.frameCount)
440457
AddKeyFrame(videoReader.frameCount - 1);
441458
else AddKeyFrame(dataEndFrame.Value - 1);
@@ -456,7 +473,8 @@ public void SendToRecentering()
456473
OutlierThresholdY = _outlierThresholdY,
457474
OutlierThresholdRadius = _outlierThresholdRadius
458475
};
459-
RecenteringViewModel.LoadFromStimulusGaze(videoFilePath, DisplayedGazeLocations, dataStartFrame.Value, EyetrackingFPS, filterSettings, gazeFileName);
476+
RecenteringViewModel.LoadFromStimulusGaze(videoFilePath, DisplayedGazeLocations, dataStartFrame.Value,
477+
EyetrackingFPS, filterSettings, gazeFileName);
460478
SwitchToRecenteringTab?.Invoke();
461479
}
462480

@@ -526,31 +544,4 @@ private async Task ApplyFilter()
526544
UpdateDisplay();
527545
}
528546
}
529-
530-
public class TrailGazePoint : ReactiveObject
531-
{
532-
public double Left
533-
{
534-
get;
535-
set => this.RaiseAndSetIfChanged(ref field, value);
536-
}
537-
538-
public double Top
539-
{
540-
get;
541-
set => this.RaiseAndSetIfChanged(ref field, value);
542-
}
543-
544-
public double Opacity
545-
{
546-
get;
547-
set => this.RaiseAndSetIfChanged(ref field, value);
548-
}
549-
550-
public bool IsVisible
551-
{
552-
get;
553-
set => this.RaiseAndSetIfChanged(ref field, value);
554-
} = false;
555-
}
556-
}
547+
}

0 commit comments

Comments
 (0)