Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorial:nirs_singlechannel [2018/07/12 14:48]
sophie [Define epochs of interest]
tutorial:nirs_singlechannel [2018/07/12 14:51] (current)
sophie [Remove artifacts]
Line 83: Line 83:
   [data] = ft_preprocessing(cfg);​   [data] = ft_preprocessing(cfg);​
  
-When working with .oxy3-files,​ the optode template needs to be loaded. **[[reference:​ft_preprocessing|ft_preprocessing]]** opens a user interface dialogue to specify the template file. By default this file is located in C:\Program Files (x86)\Artinis Medical Systems BV\Oxysoft 3.0.103. The file to select is “optodetemplates.xml”. However, given that Fieldtrip ​often will search for this function, it is best to copy this function to the same folder as where your Matlab analysis script and/or your fNIRS are data stored.+When working with .oxy3-files,​ the optode template needs to be loaded. **[[reference:​ft_preprocessing|ft_preprocessing]]** opens a user interface dialogue to specify the template file. By default this file is located in C:\Program Files (x86)\Artinis Medical Systems BV\Oxysoft 3.0.103. The file to select is “optodetemplates.xml”. However, given that FieldTrip ​often will search for this function, it is best to copy this function to the same folder as where your Matlab analysis script and/or your fNIRS are data stored.
  
 FieldTrip is finished when you see something like this on the screen: FieldTrip is finished when you see something like this on the screen:
Line 108: Line 108:
 Let us go through these one-by-one. The field '​hdr'​ contain all top-level information about your data, like for example the original sample rate, the number of channels etc. So all information that was potentially available at the  time you read in the dataset. The field '​label'​ lists the name of all channels that you decided to read in. Note that you have told **[[reference:​ft_preprocessing|ft_preprocessing]]** to just read-in a subset of channels. Here, however, we decided to read in both channels, and as each channel consists of measurements of 2 wavelengths,​ we end up with four of them. You also read in a set of ADC-channels,​ these will be ignored for now (these contain the triggers of the oxymon file, hence, this is NIRS acquisition hardware specific). The next field is called '​time'​ and represents the time axis of the dataset. The field '​trial'​ contains the data of all your channels. It is called '​trial'​ because usually, data is separated into different trials. To start off, we however have now read in all available data. The field '​fsample'​ describes the current sample rate of the data in the '​trial'​-field. The field '​sampleinfo'​ describes the sample numbers of each trial with respect to the original measurement. The field '​opto'​ contains all high-level information about the composition of the channels and optodes, such as what wavelengths were used, the position of the optodes, what optodes formed which channels, etc. Finally, the field '​cfg'​ is the same cfg that we have just used, extended by some default values. This way, we can always trace back what has actually happened to our data. But more about that later. Let us go through these one-by-one. The field '​hdr'​ contain all top-level information about your data, like for example the original sample rate, the number of channels etc. So all information that was potentially available at the  time you read in the dataset. The field '​label'​ lists the name of all channels that you decided to read in. Note that you have told **[[reference:​ft_preprocessing|ft_preprocessing]]** to just read-in a subset of channels. Here, however, we decided to read in both channels, and as each channel consists of measurements of 2 wavelengths,​ we end up with four of them. You also read in a set of ADC-channels,​ these will be ignored for now (these contain the triggers of the oxymon file, hence, this is NIRS acquisition hardware specific). The next field is called '​time'​ and represents the time axis of the dataset. The field '​trial'​ contains the data of all your channels. It is called '​trial'​ because usually, data is separated into different trials. To start off, we however have now read in all available data. The field '​fsample'​ describes the current sample rate of the data in the '​trial'​-field. The field '​sampleinfo'​ describes the sample numbers of each trial with respect to the original measurement. The field '​opto'​ contains all high-level information about the composition of the channels and optodes, such as what wavelengths were used, the position of the optodes, what optodes formed which channels, etc. Finally, the field '​cfg'​ is the same cfg that we have just used, extended by some default values. This way, we can always trace back what has actually happened to our data. But more about that later.
  
-Let us dive deeper into our data for now. For having a quick look at our data, we can use the function **[[reference:​ft_databrowser|ft_databrowser]]** . The databrowser is much more than a simple 'data browser',​ but we will utilize this functionality for our purpose at the moment. Of course, we could have a look at how to call the databrowser (help **[[reference:​ft_databrowser|ft_databrowser]]**),​ but a good guess is always to use fieldtrip ​functions as ft_functionname(cfg,​ data). We can keep the cfg empty to start with, and then see if this works:+Let us dive deeper into our data for now. For having a quick look at our data, we can use the function **[[reference:​ft_databrowser|ft_databrowser]]** . The databrowser is much more than a simple 'data browser',​ but we will utilize this functionality for our purpose at the moment. Of course, we could have a look at how to call the databrowser (help **[[reference:​ft_databrowser|ft_databrowser]]**),​ but a good guess is always to use FieldTrip ​functions as ft_functionname(cfg,​ data). We can keep the cfg empty to start with, and then see if this works:
  
   cfg = [];   cfg = [];
Line 155: Line 155:
   [cfg, artifact] = ft_artifact_zvalue(cfg,​ data);   [cfg, artifact] = ft_artifact_zvalue(cfg,​ data);
  
-You will see that Fieldtrip ​removed 8 artifacts through this procedure.+You will see that FieldTrip ​removed 8 artifacts through this procedure.
 === Exercise 2 === === Exercise 2 ===
 <note exercise> ​ <note exercise> ​