read spike data in Matlab
2 posters
Page 1 of 1
read spike data in Matlab
Hello,
I have some trouble reading spike data in Matlab. I have copied mcintfac folder from MCStreamSupport to Matlab\toolbox\ and I can use its functions. First I load the .mcd file
file = datastrm('reg1.mcd');
and I can get some information from it doing this:
SpikeInfo = getfield(file, 'StreamInfo', {2})
My file only has two streams 'Trigger 1' and 'Spikes 2'.
I want to get the timestamps from the spikes of every electrode and, if possible, its waveforms, and I don't know how to do it.
Could you help me?
Thanks,
Víctor.
I have some trouble reading spike data in Matlab. I have copied mcintfac folder from MCStreamSupport to Matlab\toolbox\ and I can use its functions. First I load the .mcd file
file = datastrm('reg1.mcd');
and I can get some information from it doing this:
SpikeInfo = getfield(file, 'StreamInfo', {2})
My file only has two streams 'Trigger 1' and 'Spikes 2'.
I want to get the timestamps from the spikes of every electrode and, if possible, its waveforms, and I don't know how to do it.
Could you help me?
Thanks,
Víctor.
victorteleco- Posts : 8
Join date : 2012-06-21
Re: read spike data in Matlab
The "mcintfac"-interface is no longer actively supported.
Please consider to use Neuroshare to read the data.
You can download the latest version of our dll here:
http://www.multichannelsystems.com/software/neuroshare
The Neuroshare to Matlab interface can be downloaded here:
http://neuroshare.sourceforge.net/download.shtml
Then following command should be sufficient to access spike data
[nsresult] = ns_SetLibrary('nsMCDlibrary.dll')
[nsresult, hfile] = ns_OpenFile('NeuroshareExample.mcd')
[nsresult,entity] = ns_GetEntityInfo(hfile,x)
[nsresult,segment] = ns_GetSegmentInfo(hfile,x)
[nsresult, segmentsource] = ns_GetSegmentSourceInfo(hfile,8,x)
[nsresult,timestamp,data,samplecount,unitid] = ns_GetSegmentData(hfile,x,i)
x is the entity number of the channels containing spikes
i is the the Item of the entity which should be accessed
Best Jens
Please consider to use Neuroshare to read the data.
You can download the latest version of our dll here:
http://www.multichannelsystems.com/software/neuroshare
The Neuroshare to Matlab interface can be downloaded here:
http://neuroshare.sourceforge.net/download.shtml
Then following command should be sufficient to access spike data
[nsresult] = ns_SetLibrary('nsMCDlibrary.dll')
[nsresult, hfile] = ns_OpenFile('NeuroshareExample.mcd')
[nsresult,entity] = ns_GetEntityInfo(hfile,x)
[nsresult,segment] = ns_GetSegmentInfo(hfile,x)
[nsresult, segmentsource] = ns_GetSegmentSourceInfo(hfile,8,x)
[nsresult,timestamp,data,samplecount,unitid] = ns_GetSegmentData(hfile,x,i)
x is the entity number of the channels containing spikes
i is the the Item of the entity which should be accessed
Best Jens
Re: read spike data in Matlab
Hello,
I've downloaded nsMCDLibrary and I've followed the steps for using this library as the manual says. I downloaded FIND and decompress it in Program Files and now I get this error
NEV file could not be loaded!
nsresult =
-2
I do the following:
cd 'C:\Program Files\FIND'
[nsresult] = ns_SetLibrary('nsMCDlibrary.dll')
[nsresult, hfile] = ns_OpenFile('C:\Example.mcd')
[nsresult,entity] = ns_GetEntityInfo(hfile,1)
The error is produced when Matlab tries to open the file. I have tried using other .mcd file even the example file included with Neuroshare.
What can I do now?
I've downloaded nsMCDLibrary and I've followed the steps for using this library as the manual says. I downloaded FIND and decompress it in Program Files and now I get this error
NEV file could not be loaded!
nsresult =
-2
I do the following:
cd 'C:\Program Files\FIND'
[nsresult] = ns_SetLibrary('nsMCDlibrary.dll')
[nsresult, hfile] = ns_OpenFile('C:\Example.mcd')
[nsresult,entity] = ns_GetEntityInfo(hfile,1)
The error is produced when Matlab tries to open the file. I have tried using other .mcd file even the example file included with Neuroshare.
What can I do now?
victorteleco- Posts : 8
Join date : 2012-06-21
Re: read spike data in Matlab
nsresult =
0
info =
LibVersionMaj: 2
LibVersionMin: 1
APIVersionMaj: 1
APIVersionMin: 3
Description: 'neuroshare Library to import Multi Channel Systems data files'
Creator: 'Multi Channel Systems'
Time_Year: 2007
Time_Month: 2
Time_Day: 16
Flags: 'NONE'
MaxFiles: 256
FileDescCount: 1
FileDesc: [1x1 struct]
0
info =
LibVersionMaj: 2
LibVersionMin: 1
APIVersionMaj: 1
APIVersionMin: 3
Description: 'neuroshare Library to import Multi Channel Systems data files'
Creator: 'Multi Channel Systems'
Time_Year: 2007
Time_Month: 2
Time_Day: 16
Flags: 'NONE'
MaxFiles: 256
FileDescCount: 1
FileDesc: [1x1 struct]
victorteleco- Posts : 8
Join date : 2012-06-21
Re: read spike data in Matlab
You version of nsMCDLibrary is 2.1
Please try the latest version which is 3.4
Please try the latest version which is 3.4
Re: read spike data in Matlab
I've realized that I was using the version 2.1.0 of nsMCDLibrary.dll because of FIND so I've copied the latest version of the dll to FIND's directory. Now this is my matlab code
cd 'C:\Archivos de programa\FIND'
[nsresult] = ns_SetLibrary('nsMCDlibrary.dll')
[nsresult, hfile] = ns_OpenFile('C:\Documents and Settings\Víctor\Escritorio\mcd\Matlab\id48-05-09-ctrl.mcd')
[nsresult,entity] = ns_GetEntityInfo(hfile,1)
[nsresult,info] = ns_GetLibraryInfo()
[nsresult,segment] = ns_GetSegmentInfo(hfile,1)
[nsresult, segmentsource] = ns_GetSegmentSourceInfo(hfile,8,1)
[nsresult,timestamp,data,samplecount,unitid] = ns_GetSegmentData(hfile,1,2)
and I get this error
Some entities do not exist (ns_GetSegmentInfo).
ns_GetSegmentInfo returned a ZERO sample count for the data!
(Required for ns_GetSegmentData)
??? Undefined function or method 'log2' for input arguments of type 'char'.
Error in ==> ns_GetSegmentData at 58
UnitID(ind) = log2(UnitID(ind));
Error in ==> spikes1 at 14
[nsresult,timestamp,data,samplecount,unitid] = ns_GetSegmentData(hfile,1,2)
cd 'C:\Archivos de programa\FIND'
[nsresult] = ns_SetLibrary('nsMCDlibrary.dll')
[nsresult, hfile] = ns_OpenFile('C:\Documents and Settings\Víctor\Escritorio\mcd\Matlab\id48-05-09-ctrl.mcd')
[nsresult,entity] = ns_GetEntityInfo(hfile,1)
[nsresult,info] = ns_GetLibraryInfo()
[nsresult,segment] = ns_GetSegmentInfo(hfile,1)
[nsresult, segmentsource] = ns_GetSegmentSourceInfo(hfile,8,1)
[nsresult,timestamp,data,samplecount,unitid] = ns_GetSegmentData(hfile,1,2)
and I get this error
Some entities do not exist (ns_GetSegmentInfo).
ns_GetSegmentInfo returned a ZERO sample count for the data!
(Required for ns_GetSegmentData)
??? Undefined function or method 'log2' for input arguments of type 'char'.
Error in ==> ns_GetSegmentData at 58
UnitID(ind) = log2(UnitID(ind));
Error in ==> spikes1 at 14
[nsresult,timestamp,data,samplecount,unitid] = ns_GetSegmentData(hfile,1,2)
victorteleco- Posts : 8
Join date : 2012-06-21
Similar topics
» Read mcd data in a 64bit system by matlab
» How can I get spike data in .mcd file?
» FIND toolbox for spike detection in MATLAB
» Exporting spike analysis data as raster plot
» How to directly import 'med' data to MATLAB
» How can I get spike data in .mcd file?
» FIND toolbox for spike detection in MATLAB
» Exporting spike analysis data as raster plot
» How to directly import 'med' data to MATLAB
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum