... | ... | @@ -123,27 +123,66 @@ For Example: |
|
|
This pattern matches for most of the marks.
|
|
|
|
|
|
**Pie Chart Example**
|
|
|
Below is the code for the pie chart separating the channel types.
|
|
|
Below is the code for the pie chart separating the channel types. This code exclusively uses the marks structure for its data.
|
|
|
```matlab
|
|
|
% Pie Chart
|
|
|
c1 = length(EEG.marks.chan_info(1).flags); % Collect Number of Epochs
|
|
|
c1 = length(EEG.marks.chan_info(1).flags); % Collect Number of Epochs
|
|
|
c2 = length(find(EEG.marks.chan_info(2).flags)); % Collect the Number of Epochs flagged for mark 2 (ch_sd)
|
|
|
c3 = length(find(EEG.marks.chan_info(3).flags)); % Collect the Number of Epochs flagged for mark 3 (low_r)
|
|
|
c4 = length(find(EEG.marks.chan_info(4).flags)); % Collect the Number of Epochs flagged for mark 4 (bridge)
|
|
|
cm = length(find(EEG.marks.chan_info(1).flags)); % Collect the Number of Epochs flagged for mark 1 (manual)
|
|
|
c1 = c1-cm; % Update c1 to be the Number of Epochs not flagged for mark 1 (manual)
|
|
|
cpie = [c1 c2 c3 c4]; % Create cpie containing all of the other c values
|
|
|
figure; % Generate a figure window - nothing plotted yet
|
|
|
explode = [1 0 0 0]; % Set up input - Make c1 segmented out of the pie
|
|
|
ax1 = subplot(1,2,1); %Set up input - Make the pie chart the first plot of a of a 1x2 subplot grid
|
|
|
c1 = c1-cm; % Update c1 to be the Number of Epochs not flagged for mark 1 (manual)
|
|
|
cpie = [c1 c2 c3 c4]; % Create cpie containing all of the other c values
|
|
|
figure; % Generate a figure window - nothing plotted yet
|
|
|
explode = [1 0 0 0]; % Set up input - Make c1 segmented out of the pie
|
|
|
ax1 = subplot(1,2,1); %Set up input - Make the pie chart the first plot of a of a 1x2 subplot grid
|
|
|
labels = {'Remaining Channels','Comically Bad','Low Correlation','Bridged'}; %Set up input - Create cell array of labels corresponding to c values
|
|
|
pie(ax1,cpie,explode,labels); % Plot pie graph using parameters just created.
|
|
|
colormap(jet); % Set the color scheme to *jet*
|
|
|
title('Data Channel Classification'); % Set the title of the chart
|
|
|
|
|
|
pie(ax1,cpie,explode,labels); % Plot pie graph using parameters just created.
|
|
|
colormap(jet); % Set the color scheme to be jet
|
|
|
title('Data Channel Classification'); % Set the title of the chart
|
|
|
```
|
|
|
|
|
|
**Calculation->Flag->Mark/Criteria Plot Example**
|
|
|
Below is the code for the s way subplot of calculating channel marks. This code exclusively uses the EEG. calculation matrices for its data.
|
|
|
```matlab
|
|
|
% Collect Data
|
|
|
z = EEG.data_sd_ch; % Finding the calculated values of the standard deviations
|
|
|
z(z>100) = 100; % Cap on the max deviation value, nice to show a better color gradient on the image. Just for looks.
|
|
|
|
|
|
figure; % Generate a figure window - nothing plotted yet
|
|
|
|
|
|
% Surface Plot 1
|
|
|
ax1 = subplot(1,3,1); % Select the subplot location for the upcoming plot to be space 1 in the 1x3.
|
|
|
surf(ax1,z,'LineStyle','none','FaceAlpha',0.9); % Plot the surface wave without grid lines and a 90% opacity.
|
|
|
view(0,90); % Rotate the surface plot so that it is 2D birds eye view
|
|
|
title('Standard Deviations'); %Add a title
|
|
|
xlabel('Epoch Number'); %Add a y- axis label
|
|
|
ylabel('Channel Number'); %Add a x- axis label
|
|
|
axis([0 size(z,2) 0 size(z,1)]); %Trim the image axis so that it is plotted as a tight fit. (xmin xmax ymin ymax)
|
|
|
colormap(jet); %Set the color scheme to be jet
|
|
|
|
|
|
% Surface Plot 2 - Compact version similar to Surface plot 1
|
|
|
ax2 = subplot(1,3,2); % Subplot location is 2 in the 1x3
|
|
|
surf(ax2,EEG.c_data_sd_ch,'LineStyle','none','FaceAlpha',0.9);view(0,90); % Data plotted this time is the flags EEG.c_data_sd_ch
|
|
|
title('Flags'); colormap(jet); axis([0 size(z1,2) 0 size(z1,1)]);
|
|
|
xlabel('Epoch Number'); ylabel('Channel Number');
|
|
|
|
|
|
% Critical Value Data
|
|
|
x = mean(EEG.c_data_sd_ch,2); % Row vector, Average of flags along each channel
|
|
|
y = 1:size(EEG.c_data_sd_ch,1); % Row vector, Channels numbers
|
|
|
x(:,2) = 0.1; % Second row vector in variable x, vertical line with equation x = 0.1
|
|
|
ax3 = subplot(1,3,3); % Subplot location
|
|
|
plot(ax3,x,y); % Plot of the x and y vectors to make a graph
|
|
|
title('Mean of Marks Critical Value'); % Standard plotting labels
|
|
|
xlabel('% Of Channel Flagged');
|
|
|
ylabel('Channel Number');
|
|
|
axis([-0.05 1 0 (length(x + 1))]); % Axis trimming (xmin xmax ymin ymax)
|
|
|
````
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
... | ... | |