Users Guide

Users%20Guide

Users%20Guide

Users%20Guide

Users%20Guide

Users%20Guide

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 6

DownloadUsers Guide
Open PDF In BrowserView PDF
Neural Processing MATLAB Kit
User’s Manual

Kian Torab
Blackrock Microsystems

Rev. 1.0

Introduction*
What*is*NPMK?*
NPMK% is% a% MATLAB% toolkit% containing% several% tools% that% are% used% to%
open,% manipulate% and% perform% basic% data% analysis% of% Blackrock%
Microsystems%data%files%(NEV%and%NSx).%
Data*Files*
Blackrock%Microsystems%data%is%saved%in%two%types%of%files:%
• NEV:%Short%for%Neural%EVents,%it%contains%events%recorded%during%a%
experimental% session.% These% events% may% include% information% on%
thresholdIcrossed% spike% waveforms,% information% received%
through%the%digital%input%and%the%serial%input,%tracking%information%
recorded%in%NeuroMotive%Video%Tracking%System,%text%comments,%
or%other%custom%comments%sent%to%the%NSP%during%an%experiment.%
• NSx:% Short% for% Neural% Stream% X,% where% X% indicates% the% sampling%
frequency% of% the% continuous% file.% This% data% type% contains%
continuous%streamed%data%to%the%NSP.%Depending%on%the%sampling%
frequency,%a%second%of%data%may%contain%up%to%30,000%samples%in%
this%file.%
o
o
o
o
o

NS1:%Data%sampled%at%500%Hz%
NS2:%Data%sampled%at%1%kHz%
NS3:%Data%sampled%at%2%kHz%
NS4:%Data%sampled%at%10%kHz%
NS5:%Data%sampled%at%30%kHz%

File*Specifications*(Format)*
The% data% files% can% be% recorded% in% various% file% specifications.% Currently,%
NPMK% supports% file% formats% 2.1,% 2.2,% and% 2.3.% Refer% to% the% file% format%
documentation%for%details%on%what%each%file%format%contains.%Blackrock%
Microsystems% recommends% using% the% latest% file% format% to% record% your%
data.%
%

Reading*Data*Files*
openNEV*
Opens%a%NEV%file%for%reading,%returns%all%file%information%in%a%MATLAB%
structure.%If%an%output%argument%is%not%specified%the%default%structure%name%
will%be%NEV.%Works%with%file%specifications%2.1%&%2.2%&%2.3.%
%
openNEV%
%
To%open%a%NEV%file%containing%the%basic%header%information,%digital%
input%values,%and%spike%timestamps.%
%
openNEV(‘read’)%
%
To%open%a%NEV%file%containing%the%basic%header%information,%digital%
input%values,%spike%waveforms%and%timestamps,%comments,%
NeuroMotive%tracking%information,%custom%events,%etc.%
%
Note%that%all%input%arguments%are%optional.%Input%arguments%may%be%in%any%
order.%Other%optional%inputs%are:%
%
‘fname’:%
File%name%of%the%data%file%to%be%opened.%
‘report’:%
The%function%will%display%a%read%report%in%MATLAB%prompt%
‘nowarning’:% By%default,%the%function%will%display%an%warning%when%errors%occur.%
This%%argument%will%suppress%the%warning.%
‘nosave’:%%
By%default,%openNEV%will%save%a%copy%of%the%NEV%structure%in%a%
MATLAB%file.%This%will%accelerate%subsequent%readings%of%the%same%
NEV%file%significantly.%
‘nomat’:%
By%default,%openNEV%will%look%for%a%MAT%file%version%of%the%data%file%
and%loads%it%for%faster%file%load.%This%argument%will%force%openNEV%to%
ignore%the%MAT%file.%
‘uV’:%
By%default,%all%values%in%the%spike%waveforms%are%raw%data%files.%The%
‘uV’%argument%will%load%the%waveforms%in%units%of%uV.%
‘overwrite’:% Passing%this%argument%will%automatically%overwrite%the%MAT%file%
without%prompting%the%user%in%a%case%a%MAT%file%already%exists.%
‘8bits’:%
By%default,%openNEV%reads%data%from%the%16Ibit%digital%port.%If%this%
argument%is%passed%then%only%the%lower%8Ibits%are%read%and%the%upper%
8Ibits%are%ignored.%
‘t:XX:XX’%
By%default,%the%entire%file%is%read.%However,%the%user%can%specify%only%a%
portion%of%the%file%to%be%read.%For%example,%to%read%the%first%50%seconds%
the%user%can%pass%‘t:1:50’%argument%to%openNEV.%

openNEV('report','read', t:50:100’, ‘uV’, ‘nomat’, ‘nosave’);

In%the%example%above,%the%file%dialogue%will%prompt%for%a%file.%A%report%of%the%
file%contents%will%be%shown.%The%spike%waveforms%are%in%units%of%uV.%Only%the%
data%from%50I100%seconds%will%be%read.%openNEV%is%forced%to%ignore%any%MAT%
files%and%reIload%the%actual%NSx%file%instead.%The%loaded%data%will%also%not%be%
saved%as%a%MAT%file.%
openNEV('report','read');

In%the%example%above,%the%file%dialogue%will%prompt%for%a%file.%A%report%of%the%
file%contents%will%be%shown.%The%digital%data%will%not%be%parsed.%The%data%
needs%to%be%in%the%proper%format%(refer%below).%The%spike%waveforms%are%in%
raw%units%and%not%in%uV.%

openNSx*
Opens%a%NSx%file%for%reading,%returns%all%file%information%in%a%MATLAB%
structure.%If%an%output%argument%is%not%specified%the%structure%name%will%be%
NSx,%where%x%can%be%1I5%depending%on%the%data%file%read.%Works%with%file%
specifications%2.1%&%2.2%&%2.3.%
%
openNSx

%
%

To%open%a%NSx%file%containing%the%basic%header%information%only.%

openNSx(‘read’)

%
To%open%a%NSx%file%containing%the%basic%header%information%and%all%the%
continuous%data.%
%
Note%that%all%input%arguments%are%optional.%Input%arguments%may%be%in%any%
order.%Other%optional%inputs%are:%
%
‘fname’:%
File%name%of%the%data%file%to%be%opened.%
%‘report’:%
The%function%will%display%a%read%report%in%MATLAB%prompt%
‘nowarning’:% By%default,%the%function%will%display%an%warning%when%errors%occur.%
This%%argument%will%suppress%the%warning.%
‘e:XX:XX’:%%
By%default,%openNSx%will%read%all%the%channels.%The%user%can%specify%
only%a%few%electrodes%to%be%read.%In%this%case,%openNSx%will%prompt%for%
a%CMP%file.%
‘c:XXIXX:%
By%default,%openNSx%will%read%all%the%channels.%The%user%can%specify%
only%a%few%channels%to%be%read.%
‘uV’:%
By%default,%all%values%in%the%spike%waveforms%are%raw%data%files.%The%
‘uV’%argument%will%load%the%waveforms%in%units%of%uV.%

‘overwrite’:%
‘8bits’:%

‘t:XX:XX’%

‘mode’:%
‘p:XXX’:%
‘s:XX:%

Passing%this%argument%will%automatically%overwrite%the%MAT%file%
without%prompting%the%user%in%a%case%a%MAT%file%already%exists.%
By%default,%openNEV%reads%data%from%the%16Ibit%digital%port.%If%this%
argument%is%passed%then%only%the%lower%8Ibits%are%read%and%the%upper%
8Ibits%are%ignored.%
By%default,%the%entire%file%is%read.%However,%the%user%can%specify%only%a%
portion%of%the%file%to%be%read.%For%example,%to%read%the%first%50%seconds%
the%user%can%pass%‘t:1:50’%argument%to%openNEV.%
Mode%will%describe%the%numbers%used%in%the%‘t:XX:XX’%argument.%Mode%
can%be%‘sample’,%‘sec’,%‘min’,%or%‘hour’.%
By%default,%all%samples%are%read%in%usigned%16Ibit%format.%If%‘double’%is%
passed%as%an%argument%all%samples%will%be%read%in%double%precision.%
This%argument%can%be%used%to%read%a%downIsampled%version%of%the%
data%for%quick%look.%For%example,%if%s:2%then%every%other%sample%is%
loaded.%

%
Example:%
openNSx('report','read','c:\data\sample.ns5','e:15:30','t:3:10','
min', 'p:short', 's:5');

In%the%example%above,%the%file%c:\data\sample.ns5%will%be%used.%A%report%of%
the%file%contents%will%be%shown.%The%data%will%be%read%from%electrodes%15%
through%50%in%the%3I10%minute%time%interval.%A%decimated%version%of%the%
datafile%will%be%read,%where%only%every%5th%sample%is%read.%
%

%

openNSx('read’, ‘c:15:30’);%

%
In%the%example%above,%the%file%user%will%be%prompted%for%the%file.%The%file%will%
be%read%using%'int16'%precision%as%default.%Data%from%channels%15%through%30%
will%be%read%only.%
%

Data*Manipulation*
combineNSxNEV*
This%function%loads%two%NSx%and%NEV%files%and%it%will%combine%them%together%
into%one%file.%The%resulting%file%will%be%saved%as%new%NSx%and%NEV%files.%
[NSx, NEV] = combineNSxNEV(filename1, filename2)

Note%that%all%input%arguments%are%optional.%Input%arguments%may%be%in%any%
order.%
%
filename1:%
filename2:%
NSx:%
NEV:%

The%name%of%the%first%NSx%file.%In%its%absense,%a%dialog%will%open%and%
will%prompt%the%user%to%select%an%NSx%file.%
The%name%of%the%second%NSx%file.%In%its%absense,%a%dialog%will%open%and%
will%prompt%the%user%to%select%an%NSx%file.%
The%combined%NSx%structure.%
The%combined%NEV%structure.%

calcTimeDelay*
This%function%calculates%the%time%difference%between%the%end%of%the%first%NSx%
file%and%the%beginning%of%the%second%NSx%file.%It%is%useful%in%cases%where%one%
needs%to%calculate%the%time%it%took%to%stop%one%file%recording%and%start%the%next%
one.%
timeDelay = calcTimeDelay(NSx1, NSx2)

Note%that%all%input%arguments%are%optional.%Input%arguments%may%be%in%any%
order.%
%
NSx1:%%%%%%%%

%
NSx2:%%%%%%%%

timeDelay:%

%

The%first%NSx%file%passed%to%the%function.%This%input%is%optional.%In%its%
absense,%a%dialog%will%open%and%will%prompt%the%user%to%select%an%NSx%
file.%
The%second%NSx%file%passed%to%the%function.%This%input%is%also%optional.%
In%its%absense,%a%dialog%will%open%and%will%prompt%the%user%to%select%an%
NSx%file.%
The%calculated%time%delay.%



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
Linearized                      : No
Page Count                      : 6
PDF Version                     : 1.4
Title                           : Microsoft Word - Users Guide.docx
Author                          : Kian Torab
Producer                        : Mac OS X 10.7.2 Quartz PDFContext
Creator                         : Word
Create Date                     : 2012:01:13 06:15:27Z
Modify Date                     : 2012:01:13 06:15:27Z
EXIF Metadata provided by EXIF.tools

Navigation menu