Figure Classifiers and artifact detection panel Figure 15 Individual classifier configuration tab Figure Classes panel Figure 17 Individual class configuration tab Figure Image classification tool IEnumerable<EEGDataEntry[]> trials = /* Get trial data from somewhere */; int minCount = trials.Min(t => t.Length); var examples = trials.Select(t => { var means = Channels.Values.Select(ch => t.Select(e => e[ch]).Average()).ToArray(); return new Example(t[0].Marker, t.Take(minCount) .SelectMany(e => e.Select((d, i) => d - means[i])) .Concat(means)); }).ToArray(); Figure 19 Data processing in C# This code example demonstrates many powerful data processing features of C#. The purpose of this code is to convert a sequence (IEnumerable) of trials (each represented by an array of EEGDataEntries) into an array of Examples which can be fed to a classifier. This requires flattening the multi-dimensional data in each trial (some number of entries x 14 channel’s worth of data per entry) into a single sequence of voltage values. Along the way we also want to subtract out the mean voltage value along each channel, and then append these mean values to the end of the feature sequence. Furthermore, since by chance some trials have a few more examples than others, we need to ensure that the resultant example feature sets are trimmed such that the features in each example line up regardless of the length of the original trial. In many popular programming languages, this would require many lines of code with multiple loops. In C#, we require neither. This code may seem arcane at first, but it is easy to break down. The code is peppered with inline anonymous functions (also called lambda functions). These functions are designated with the => operator, which can be interpreted as “goes to”. Thus the anonymous function t => t.Length
3. Stimulus Class Setup: Step 1 When a stimulus class is loaded, a new tab is created for the class. The controls on this class allow various class parameters to be configured. The Name field is used to refer to the class during experiments. The Marker field acts as a numerical identifier for the class and is used to tag EEG data while a stimulus from the class is being displayed. The Question and Answer fields are used to specify the subcategories for stimuli in the class. For example, a faces class might have “Was the person male or female?”, “male”, and “female” in these fields. Clicking on a stimulus in the list of stimuli causes that stimulus to be displayed on the right side of the tab. The drop down list beneath the stimulus can then be used to set the stimulus’s subcategory. Unchecking the checkbox next to a stimulus excludes that stimulus from being used in experiments. 4. Stimulus Class Setup: Step 2 Since specifying the subcategory of hundreds of images is rather tedious, Experimenter provides a tool to assist with this process which can be accessed via the Classify button on the class’s tab. The tool allows the user to run through the images, classifying them one by one in rapid succession. Keyboard shortcuts to the various buttons make this process very efficient. 5. Image Display Configuration After the stimuli are loaded, the next step is to configure how they are displayed. The image display configuration panel contains several controls for this purpose. If the Cycle Through Images box is checked, the sample images displayed on the right change periodically, which can be helpful to determine whether the settings are appropriate. 6. Classifier Setup Classifiers can be created/loaded via the New and Load buttons on the Classifiers tab. Like each