= Tutorial 12: Explore the average response = ''Authors: Francois Tadel, Elizabeth Bock, Sylvain Baillet'' <> = From continuous tutorials: = == Explore the average == Open the time series for the "'''Avg: left'''". Then press '''Control+T''', to see on the side a spatial topography at the current time point. Then observe what is happening between 0ms and 100ms. Start at 0ms and play it like a movie using the arrow keys left and right, to follow the brain activity millisecond by millisecond: * '''16 ms''': First response, the sensory information reaches the right somatosensory cortex (S1) * '''30 ms''': Stronger and more focal activity in the same region, but with a source oriented in the opposite direction (S1) * '''60 ms''': Activity appearing progressively in a more lateral region (S1 + S2) * '''70 ms''': Activity in the same area in the left hemisphere (S2 left + S2 right) {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutRawAvg?action=AttachFile&do=get&target=avg16.gif|avg16.gif|class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutRawAvg?action=AttachFile&do=get&target=avg30.gif|avg30.gif|class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutRawAvg?action=AttachFile&do=get&target=avg60.gif|avg60.gif|class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutRawAvg?action=AttachFile&do=get&target=avg70.gif|avg70.gif|class="attachment"}} = From CTF = == Display recordings == Several display modes are available for recordings. They are all accessible with a right-click.The first four menus (MEG, MEG REF, Stim, Video), represent all the different types of channels that were found in the channel file. You can check that with Channel Edit (right-click on channel file > Edit). We are only interested in the "MEG" in this tutorial. Select Left / ERF > MEG > Display time series. {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=treePopupRecordings.gif|treePopupRecordings.gif|class="attachment"}} . Now repeat this operation several times to display all the available modes: ''Display time series, 3D sensor cap, 2D sensor cap, 2D disc'' and ''2D Layout''. You should now see all the figures displayed below. Keep them opened for the next few paragraphs, you will learn how to manipulate multiple views of the same data. === 3D Sensor cap / 2D Sensor cap / 2D Disc === The recordings at a given time instant and interpolated over a 2D or 3D surface. {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data3Dcap.gif|data3Dcap.gif|height="175px",width="204px",class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data2Dcap.gif|data2Dcap.gif|height="174px",width="203px",class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data2Ddisc.gif|data2Ddisc.gif|height="173px",width="201px",class="attachment"}} Keyboard and mouse shortcuts: * '''Mouse wheel''': Zoom / unzoom * '''Left click + move''': Rotate (3D only) * '''Middle click + move''': Or left+right click + move: Move in zoomed figure * '''Right click + move''': Select sensors (2D only, when sensors are visible, see below) * '''Right click''': Popup menu * '''Left click on the colorbar + move''': Change contrast (up/down) and brightness (left/right) * '''Control + E''': Display the channels markers and/or names * '''Keyboard arrows''': Change current time * '''PageUp / PageDown''': Change current time (10 samples at a time) / Mac: Fn+UP/Fn+Down === 2D layout === The time course of each channel is drawn at the actual position of the electrode, projected in 2D the same way as ''2D Sensor cap''. The light gray lines represent the zero amplitude (horizontal) and the current time (vertical lines). {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data2Dlayout.gif|data2Dlayout.gif|class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data2DlayoutWhite.gif|data2DlayoutWhite.gif|class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data2DlayoutMenu.gif|data2DlayoutMenu.gif|class="attachment"}} Only a part of the full time window is displayed for each channel, before and after the current time. The length of this time window can be modified either with the mouse shortcut Control+wheel, or with the 2D Layout options, in the figure popup menu. Other options are also available in the popup menu. * '''Mouse wheel''': Zoom / unzoom * '''Middle click + move''': (or left+right click + move) Move into the zoomed figure * '''Shift + mouse wheel''': Increase/decrease the amplitude gain of the channels * '''Control + mouse wheel''': Increase/decrease the length of the time window around the current time * '''Click on a line''': Select a sensor * '''Right click + move''': Select a group of sensors * '''Shift + click on a line''': Select one sensor and unselect all the others Display the time-frequency decomposition for the selected sensor, when available * '''Right-click''': Display popup menu. Sub-menu "2DLayout options" offer some configuration options for this type of figure. * '''Control + E''': Display/hide the channels names * '''Keyboard arrows''': Change current time * '''PageUp / PageDown''': Change current time (10 samples at a time) / Mac: Fn+UP/Fn+Down == Magnetic interpolation == Some of the views (3D Sensor cap / 2D Sensor cap / 2D Disc), are by default re-interpolating the field that is recorded by the sensors to get much smoother displays. A simple inverse problem + forward problem are solved to reconstruct the magnetic fields on a high-resolution surface. The menu '''"No magnetic interpolation"''' offer the same views, but without using this reconstruction of the magnetic field, and performing instead a spatial interpolation of the values between the sensors. {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data3DcapRaw.gif|data3Dcap.gif|height="175px",width="204px",class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data2DcapRaw.gif|data2Dcap.gif|height="174px",width="203px",class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=data2DdiscRaw.gif|data2Ddisc.gif|height="173px",width="201px",class="attachment"}} === Important note === If you are experiencing any kind of graphic bug, you should try to disable the OpenGL renderer. In Brainstorm main window, select menu File > Set preferences, and check the option "OpenGL: Disabled (no transparency)". All the 3D views would be very slow and with no transparency, but it may solve all the problems. This is more likely to happen on 64bit machines or when working on a remote system (X-server, VirtualBox, Windows remote desktop connection...). You may also try keeping the OpenGL renderer but typing "opengl software" before you run Brainstorm. It would force Matlab to do a software OpenGL rendering instead of using the 3D hardware accelerations. The display would be similar to hardware OpenGL but much slower. == Time exploration == The time window and the current time instant are centralized and managed from the top of the Brainstorm window. You can use the text box or the buttons to change the current time value. All the figures always stay synchronized, you cannot display the 2D disc topography at t=10ms and the 3D sensor cap topography at t=50ms at the same time. It might look too restrictive at the beginning, but the contrary would have made the interface much too complex; we wanted to keep it as simple and intuitive as possible. {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=timeWindow.gif|timeWindow.gif|class="attachment"}} The time window panel is not the best way to explore your recordings. There are many other shortcuts that are much faster to navigate through the time. * '''Click on ''''''time series'''''' figure''': Left-click in any white area of the figure: it will move the time cursor at this point and update all the other figures to match this new value. Don't click on a black line, it would select the corresponding channel instead of moving the time cursor. * '''Press the keyboard arrows''': Click on any data figure and try to press several time the left and right arrows, and also the ''PageUp ''and ''PageDown ''keys. This feature is really useful when you want to quickly see how the recordings are changing in time. Try holding the arrow keys for a while. It might be a bit slow because you have many figures to refresh at each time change. It is much faster if you have only one 2D figure to refresh. '''To remember''': An efficient and quick way to review your recordings just after importation is to: 1. Open a Time series window (double click on recordings file) 1. Click on the time of interest (eg. first response peak) 1. Open a topography view of your choice (2D disc, 2D sensor cap, or 3D sensor cap) You can do this by right-clicking on the time series figure > MEG Topography (or Ctrl+T keyboard shortcut). 1. Use the left/right arrows, and PageUp/PageDown keys (or Fn+Up / Fn+Down on a Mac) == Time selection == Go back to the previous view mode ("butterfly view") and in the Record tab, select the menu "All channels" again. Keep this selection for the rest of the tutorial. * Left-click somewhere on the white part of the time series figure, hold the mouse button, and drag your mouse left or right: A transparent blue rectangle appears to represent the time selection. * Now right-click on the figure to see the functions you can apply on this time window. The selected time window and its duration are shown at the bottom of the figure. . {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=timeSelection.gif|timeSelection.gif|class="attachment"}} * '''Set current time''': Just sets the time cursor when the right-click occurred. The shortcut Shift+Click can be useful when trying to move in time on dense displays in columns view. * '''Set selection manually''': Select a time window by giving the bounds in ms. * '''Average time''': Average over the selected time window, saved as a new file in the database. * '''Export to database''': Extract the recordings and save them in a new file in database. * If some sensors are selected, only their values are extracted, all the others are set to zero. * '''Export to file''': Same, but in a user-defined file (not in the database) * '''Export to Matlab''': Same, but export as a Matlab variable in the current workspace. == Snapshots == Using Brainstorm, you will quickly feel like saving the beautiful images you produce. For that you can: * Press the ''PrintScreen'' key on your keyboard and paste the copied screen in your favorite image or text editor (PC or Linux) * More subtle: ''Alt+PrintScreen'' would only copy the figure that is currently selected (PC or Linux). * On MacOS: Many more options available, Google for the best ones ([[http://graphicssoft.about.com/od/screencapturemac/ht/macscreenshot.htm|see example]]). * The ''Snapshots ''menu present in the popup of all the figures can be useful too. Here are two examples of Snapshots menus, respectively on time series and 3D figures: . {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=snapshotsTS.gif|snapshotsTS.gif|class="attachment"}} --- {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=snapshotsTopo.gif|snapshotsTopo.gif|class="attachment"}} * '''Save as image''': save the figure (without the title bar and borders) in a file. Many formats available. * '''Open as image''': capture the figure and open it in as an image. This can be useful if you want to compare visually the selected figure with another one that you cannot display at the same time (because they have different time or frequency definitions) * '''Export to database''': saves the recordings in the figure as a new entry in database * If there are selected channels, only their values will be saved, the others being set to zero. * '''Save time series''': extract the time series displayed in this figure (or only the selected sensors), and save them in a file. Available formats: * ASCII (.txt) * Matlab (.mat): saves much more information (titles, time values, etc.) * Cartool (.eph) * EGI (.raw) * '''Export to Matlab''': Same thing, but exports the structure in a variable in Matlab workspace instead of creating a new file. * '''Movie (time): Selected figure''': Create .avi movies to show time evolution of the selected figure. * The dimensions of the movie image depend on the actual size of the figure on the screen. * Don't do anything else while creating the movies: the figure which is captured must be visible all the time. * '''Movie (time): All figures''': Instead of capturing one figure only, it captures them all and creates a movie showing what you see on the screen. Arrange your figures the way you want and create a movie of all your workspace at once. . {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=movie.gif|movie.gif|class="attachment"}} * '''Movie (horizontal/vertical)''': Rotate spatially the 3D scene. == Contact sheets == * '''Contact sheet''': Produce a big image with all the time frames in it. * Same recommendations than for movies: if you don't want the final image to be too big, reduce the size of your figure, zoom a bit, and maybe hide the colorbar. Don't hide the figure during the capture. * At the end, the image is displayed in a viewer with which you can zoom (menu or wheel), move (left-click+move), and save the image (File > Save as). * The contact sheet menu also appears for the time series figure, which is not that interesting because nothing changes except for the position of the time cursor. However, it can make sense to use in combination with the same contact sheet for a 2D/3D figure. Displaying the two images side by side you would have a clear view of the exact timing of each topography. {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=contactSheet.gif|contactSheet.gif|height="299px",width="487px",class="attachment"}} * '''Figure menu''': Various options to edit the selected figure. * '''Standard '''(right-click on the topography figure > Snapshot > Time contact sheet) : . {{http://neuroimage.usc.edu/brainstorm/Tutorials/Auditory?action=AttachFile&do=get&target=average_sensor_standard.gif|average_sensor_standard.gif|height="286",width="370",class="attachment"}} * '''Deviant''': . {{http://neuroimage.usc.edu/brainstorm/Tutorials/Auditory?action=AttachFile&do=get&target=average_sensor_deviant.gif|average_sensor_deviant.gif|height="300",width="371",class="attachment"}} == Keyboard shortcuts == Here is a memo of all the keyboard shortcuts for time series and topography figures. If you don't remember them, you can find most of them in the figure popup menus. * '''Arrows: '''left, right, PageUp, PageDown: Move in time * '''Delete''': Mark selected sensors as ''bad'' * '''Shift + ''''''Delete''': Mark non-selected sensors as ''bad'' (=keeps ony the selected sensors) * '''Enter''': View time series for selected sensors * '''Shift + Enter''': Set all the bad sensors as good (=brings back all the channels in the display) * '''Escape''': Unselect all the selected sensors * '''Ctrl + A''': Show axis on 3D figures (X,Y,Z) * '''Ctrl + A''': Add event in raw file viewer (see raw file viewer tutorial) * '''Ctrl + B''': Set trial as bad * '''Ctrl + D''': Dock/undock figure in Matlab's figures list * '''Ctrl + E''': Show sensors and labels (E stands initially for ''Electrode'') * '''Ctrl + I''': Save figure as image * '''Ctrl + R''': Open ''Time series'' view (R stands for ''Recordings'') * '''Ctrl + S''': Open ''Sources'' view (see next tutorial) * '''Ctrl + T''': Open ''2D sensor cap'' view (T stands for ''Topography'') * '''Shift + letter''': Change sensors display when in "column" display mode for the time series. * '''F1, F2, F3''': with or without '''Shift''', calls the database navigator (F1=subject, F2=condition, F3=file) * Notes for Mac users: * PageUp = Fn + UP * PageDown = Fn + DOWN * F1 = Fn + F1 * Mouse wheel = Two finger up/down on the MacBook pad <> <>