= Tutorial 19: Clusters of sensors = ''Authors: Francois Tadel, Elizabeth Bock, Sylvain Baillet'' In EEG, most of the analysis can be done directly on the electrode values. This tutorial explains how to group sensors in a cluster and overlay channels from different conditions in the same graph. In MEG, we tend to avoid working at the sensor level because the signals are ambiguous, we work mostly in the source space, which is the topic of the next tutorials. If you are planning to work only with MEG recordings, you may skip this tutorial. <> == Cluster tab == The Cluster tab is not shown by default in the Brainstorm interface. * Click on the '''[+]''' button next to the Scout tab > '''Add: Cluster'''.<
>If the list of tabs is too busy, you can close some of them in the same way. <
><
> {{attachment:cluster_tab.gif||height="85",width="277"}} * The Cluster tab is similar to the Scout tab, but much simpler. It contains a toolbar to create and edit clusters, a list of existing clusters and a few display options at the bottom.<
><
> {{attachment:cluster_panel.gif||height="200",width="224"}} * '''[NEW SEL]''': Create a cluster containing the channels that are currently selected in the interface. * '''[NEW IND]''': Create a cluster with channels selected by index, name or type. * '''[Display clusters time series]''': Shows the time series of the selected clusters for all the files that are currently open in the interface. * '''Edit''': Menus to modify the selected clusters. == Creating clusters == A cluster is a group of one or multiple channels. There are two ways for creating a new one. * Display the MEG recordings for the '''standard average''' of '''Run#01''' (double-click on the file).<
> Add a 2D topography (Ctrl+T), display the sensors and select a group of them (right-click+move). <
><
> {{attachment:cluster_select.gif||height="117",width="356"}} * In the Cluster tab, click on '''[NEW SEL]'''. It creates a new cluster "c1". <
>Double-click on it to rename it (or menu Edit > Rename). * In the Cluster tab, click on '''[NEW IND]'''. Enter the name of the sensor "MLT12". Rename it.<
><
> {{attachment:cluster_ind.gif||height="181",width="428"}} * '''Selection''': When you change the selected cluster in the list, it selects the corresponding sensors in all the figures. The number of channels involved in the selection is displayed at the bottom of the tab. You can select multiple clusters at once, holding the Ctrl/Shift/Command button while clicking. * '''Saving''': The clusters are not saved in the database files, nor in the Brainstorm user preferences, therefore if you close Brainstorm you would lose your clusters. To keep them between sessions, you can use the ['''Save'''] and ['''Open'''] buttons on the right side of the tab. == Displaying clusters == We now have two clusters available in the list. The second one contains only one channel, displaying it corresponds to displaying the channel time series. The first one contains multiple channels, we need to apply a function to group them into one signal only. * The cluster function used to group multiple signals into one is shown on the right of the cluster list. By default it uses a simple average ("Mean"). You can edit this cluster function with the menu Edit > Set cluster function. * Select one cluster and click on the '''[Display cluster]''' button (third from the left in the toolbar). <
><
> {{attachment:cluster_view1.gif||height="149",width="434"}} * Select the two clusters at once and click on '''[''''''Display cluster]''' again. <
><
> {{attachment:cluster_view2.gif||height="140",width="344"}} * To have the two signals in the same graph, select the option '''"Overlay: Cluster"'''. Click on '''[Display]'''. <
><
> {{attachment:cluster_view3.gif||height="141",width="500"}} * In the database explorer: Double-click on the '''deviant average '''of the same run.<
>Click on '''[Display cluster]''' again, now it displays the clusters values for both conditions.<
><
> {{attachment:cluster_view4.gif||height="148",width="500"}} * Unselect '''"Overlay: Cluster"''' and select '''"Overlay: Conditions"''', it will group the signals in a different way: one graph per cluster, each one showing the two condition averages. <
><
> {{attachment:cluster_view5.gif||height="147",width="500"}} == From the database explorer == Once the clusters are defined, you can apply them to any number of files in the database in one click. * Close all the figures with the [X] button in the top-right corner of the Brainstorm figure. * In the Cluster tab, select only one of the two clusters, select '''Overlay:Condition'''. * In the database explorer, select all the '''averages for both runs'''. Right-click on one of the selected files > '''Clusters time series'''. On this graph, you can verify that the selected cluster behaves in the same way in the two acquisition runs. <
><
> {{attachment:cluster_tree1.gif||height="259",width="488"}} <
><
> {{attachment:cluster_tree2.gif||height="173",width="502"}} <)>> <> <>