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 Both sides next revision
getting_started:neuralynx_fcdc [2018/10/21 15:20]
42.49.180.224 old revision restored (2013/01/23 16:07)
getting_started:neuralynx_fcdc [2017/08/17 11:21] (current)
127.0.0.1 external edit
Line 1: Line 1:
-{{tag>neuralynx lfp dataformat}}+{{tag>neuralynx lfp dataformat}}
  
 ====== Getting started with the Neuralynx data recorded at the Donders Institute ​ ====== ====== Getting started with the Neuralynx data recorded at the Donders Institute ​ ======
Line 9: Line 9:
 ===== Background ===== ===== Background =====
  
-At the FCDC, we record brain activity using an ECoG electrode grid with 252 electrodes. The signal is amplified by a factor of 20 using a headstage amplifier (Headstage 32V-G20, Plexon Inc., Dallas, TX, USA), and subsequently low-pass filtered at 8 kHz and digitized at ~32 kHz sampling frequency using a Neuralynx amplifier (Digital Lynx, 256 channels, Neuralynx Tucson, AZ, USA). +At the Donders Institute, we record brain activity using an ECoG electrode grid with 252 electrodes. The signal is amplified by a factor of 20 using a headstage amplifier (Headstage 32V-G20, Plexon Inc., Dallas, TX, USA), and subsequently low-pass filtered at 8 kHz and digitized at ~32 kHz sampling frequency using a Neuralynx amplifier (Digital Lynx, 256 channels, Neuralynx Tucson, AZ, USA). 
  
 To deal with the tremendous amounts of data recorded each session (approximately 1.5 Gb/min), we develop a recording procedure that allows us to: To deal with the tremendous amounts of data recorded each session (approximately 1.5 Gb/min), we develop a recording procedure that allows us to:
Line 30: Line 30:
 ==== Data splitting ==== ==== Data splitting ====
  
-The Neuralynx acquisition system provides the data in a format containing the raw data directly after A/D conversion. During each recorded session, the *.nrd file is written directly to an external Lacie RAID-0 hard disk that is connected by firewire 800. The *.nrd datafiles contain a 16kB ascii header, followed by the multiplexed 32-bit channel-level data (see also [[getting_started:​neuralynx|this]] page). The huge size of these multiplexed files (>100 Gb per 45 minute session) precludes them for efficient post-processing. Using the FieldTrip ​ **[[reference:​ft_spikesplitting]]** function, we split the *.nrd file into seperate files for each channel, containing exactly the same 32-bit information. These files are written into a single directory which usually has the extension *.sdma, since it contains the "split dma&​quot; ​channels. We refer to this directory as the output dataset, whereas the *.nrd file is the input dataset.+The Neuralynx acquisition system provides the data in a format containing the raw data directly after A/D conversion. During each recorded session, the *.nrd file is written directly to an external Lacie RAID-0 hard disk that is connected by firewire 800. The *.nrd datafiles contain a 16kB ascii header, followed by the multiplexed 32-bit channel-level data (see also [[getting_started:​neuralynx|this]] page). The huge size of these multiplexed files (>100 Gb per 45 minute session) precludes them for efficient post-processing. Using the FieldTrip ​ **[[reference:​ft_spikesplitting]]** function, we split the *.nrd file into seperate files for each channel, containing exactly the same 32-bit information. These files are written into a single directory which usually has the extension *.sdma, since it contains the "split dma" ​channels. We refer to this directory as the output dataset, whereas the *.nrd file is the input dataset.
  
 An example of the configuration for spikesplitting is provided below: An example of the configuration for spikesplitting is provided below:
  
-&lt;code&gt;+<code>
 cfg         = []; cfg         = [];
 cfg.dataset = '​recording.nrd';​ cfg.dataset = '​recording.nrd';​
Line 42: Line 42:
 cfg.channel = '​all';​ cfg.channel = '​all';​
 cfg         = ft_spikesplitting(cfg);​ cfg         = ft_spikesplitting(cfg);​
-&lt;/code&​gt; ​+</code
  
 It is also important to note that:  It is also important to note that: 
Line 90: Line 90:
 In FieldTrip the relation between the timestamps and the samples is represented in the header. If you call **[[reference:​ft_read_header|ft_read_header]]** on your datafile, you'll see something like this In FieldTrip the relation between the timestamps and the samples is represented in the header. If you call **[[reference:​ft_read_header|ft_read_header]]** on your datafile, you'll see something like this
  
-  ​&​gt;&​gt; ​hdr = ft_read_header('​256_noev_DigitaLynx_DMA.nrd'​)+  ​>> ​hdr = ft_read_header('​256_noev_DigitaLynx_DMA.nrd'​)
   hdr =    hdr = 
               Fs: 32556               Fs: 32556
Line 105: Line 105:
 or this or this
  
-  ​&​gt;&​gt; ​hdr = ft_read_header('​p021parall.nex'​)+  ​>> ​hdr = ft_read_header('​p021parall.nex'​)
   hdr =    hdr = 
                 nChans: 15                 nChans: 15
Line 127: Line 127:
 ==== Dealing with triggers ==== ==== Dealing with triggers ====
  
-During acquisition the 16 bit trigger channel is sampled with 32kHz, just like all other channels. Consequently in the *.ndr DMA log file there is a &quot;ttl&​quot; ​channel that represents the triggers. The ttl channel is a 32 bit channel, although only 16 of those bits are connected to the trigger input.+During acquisition the 16 bit trigger channel is sampled with 32kHz, just like all other channels. Consequently in the *.ndr DMA log file there is a "ttl" ​channel that represents the triggers. The ttl channel is a 32 bit channel, although only 16 of those bits are connected to the trigger input.
  
 After spikesplitting,​ there is a *.ttl file containing the same 32kHz representation of the trigger channel as in the DMA log file. There are also two files (*.tsl and *.tsh) that represent the lowest and highest 32 bits of the 64 bit timestamp channel. The Neuralynx timestamp channel has a clock rate of 1MHz, i.e. 1e6 timestamps per second, or approximately 32 timestamps per data sample at 32kHz (1e6/​32556). ​ After spikesplitting,​ there is a *.ttl file containing the same 32kHz representation of the trigger channel as in the DMA log file. There are also two files (*.tsl and *.tsh) that represent the lowest and highest 32 bits of the 64 bit timestamp channel. The Neuralynx timestamp channel has a clock rate of 1MHz, i.e. 1e6 timestamps per second, or approximately 32 timestamps per data sample at 32kHz (1e6/​32556). ​
Line 137: Line 137:
 Here, we will focused on how to read the Plexon dataset directories (//_ds//) which contain multiple *.nex files. A basic configuration structure is provided below: Here, we will focused on how to read the Plexon dataset directories (//_ds//) which contain multiple *.nex files. A basic configuration structure is provided below:
  
-&lt;code&gt;+<code>
 cfg = []; cfg = [];
-cfg.dataset ​         = dataset; ​     % &quot;_ds&​quot; ​dataset directory+cfg.dataset ​         = dataset; ​     % "_ds" ​dataset directory
 cfg.dataformat ​      = '​plexon_ds'; ​ % this is optional, and will be auto-detected cfg.dataformat ​      = '​plexon_ds'; ​ % this is optional, and will be auto-detected
 cfg.headerformat ​    = '​plexon_ds'; ​ % this is optional, and will be auto-detected cfg.headerformat ​    = '​plexon_ds'; ​ % this is optional, and will be auto-detected
 cfg = ft_preprocessing(cfg) cfg = ft_preprocessing(cfg)
-&lt;/code&gt;+</code>
  
 The specification of the dataformat and headerformat options as //​combined_ds//​ ensures that the appropriate low-level FieldTrip reading function will be called to read the multiple single-channel Plexon *.nex files contained in the dataset directory. After preprocessing,​ we can obtain a data structure like this: The specification of the dataformat and headerformat options as //​combined_ds//​ ensures that the appropriate low-level FieldTrip reading function will be called to read the multiple single-channel Plexon *.nex files contained in the dataset directory. After preprocessing,​ we can obtain a data structure like this:
  
-&lt;code&gt;+<code>
 data =  data = 
  
Line 157: Line 157:
  
         cfg: [1x1 struct]         cfg: [1x1 struct]
-&lt;/code&gt;+</code>
  
 ==== Dealing with changing of channel labels ==== ==== Dealing with changing of channel labels ====
Line 165: Line 165:
 All montage files for our particular experiment are available upon request.\\ An example of changing the channel labels is provided below: All montage files for our particular experiment are available upon request.\\ An example of changing the channel labels is provided below:
  
-&lt;code&gt;+<code>
 load kurt_montage_rename_plx2elec.mat load kurt_montage_rename_plx2elec.mat
 cfg = []; cfg = [];
 cfg.montage = montage; cfg.montage = montage;
 data = ft_preprocessing(cfg,​data);​ data = ft_preprocessing(cfg,​data);​
-&lt;/code&gt;+</code>
  
 It is important to note that to change labels in our recordings on Kurt, we use two montages structures. This is because recordings between sessions 17 and 60 headstages were inversely connected to the electrode connectors. In this case, the correct montage file to use is //​kurt_montage_rename_plx2elec_17_60.mat//​. After session number 60, headstages were correctly positioned. For later sessions therefore the montage file //​kurt_montage_rename_plx2elec.mat//​ should be used. These files are available upon request.\\ It is important to note that to change labels in our recordings on Kurt, we use two montages structures. This is because recordings between sessions 17 and 60 headstages were inversely connected to the electrode connectors. In this case, the correct montage file to use is //​kurt_montage_rename_plx2elec_17_60.mat//​. After session number 60, headstages were correctly positioned. For later sessions therefore the montage file //​kurt_montage_rename_plx2elec.mat//​ should be used. These files are available upon request.\\
Line 189: Line 189:
 For example, a schematic layout of the 256 electrode grid might be obtained using the following the function **[[reference:​ft_layoutplot|ft_layoutplot]]**:​ For example, a schematic layout of the 256 electrode grid might be obtained using the following the function **[[reference:​ft_layoutplot|ft_layoutplot]]**:​
  
-&lt;code&gt;+<code>
 load kurt_layout_schematic_common load kurt_layout_schematic_common
 cfg = []; cfg = [];
 cfg.layout = ft_layout; cfg.layout = ft_layout;
 ft_layoutplot(cfg) ft_layoutplot(cfg)
-&lt;/code&gt;+</code>
  
 To obtain something like this: \\ To obtain something like this: \\
Line 202: Line 202:
  
 {{:​getting_started:​ku_039_256elec.png?​571x367}} {{:​getting_started:​ku_039_256elec.png?​571x367}}
 +
 +
 + 
 + 
 +
 +