how to read portion of .mcd file
2 posters
Page 1 of 1
how to read portion of .mcd file
Hi.
We have written Matlab code to analyze bursts from different channels of our MEA. However, we are currently converting the entire data stream from each channel into ASCII which makes the runtime of our Matlab code very long. Then we use Matlab to open the entire file pertaining to the channel of interest.
We do not need to read and store into RAM the entire sequence of times and amplitudes for a given channel. We would greatly prefer to work with the original .mcd file for a given channel and, by using pointers, read successive amplitudes as needed. In pseudocode, this is what we would like to do:
**************************
Skip the header information in the .mcd file and point to the first voltage in the .mcd vector corresponding to channel X.
Store this value in voltage[i]
Check the interval between voltage[i] and voltage[i-1]
If this interval satisfies our condition, increment pointer to next voltage in sequence and repeat.
**************************
So rather than read the entire array of voltage values (which is quite long in our case and Matlab can't handle the length), we would need to know the file format of the .mcd files. We have looked at the MEA tools but the file that handles the .mcd data opens the entire file to memory.
Can you provide us with the number of bytes for the initial file offset as well as the byte size of each subsequent block so that we can read one piece of information (i.e., one voltage point) at a time?
Thank you.
We have written Matlab code to analyze bursts from different channels of our MEA. However, we are currently converting the entire data stream from each channel into ASCII which makes the runtime of our Matlab code very long. Then we use Matlab to open the entire file pertaining to the channel of interest.
We do not need to read and store into RAM the entire sequence of times and amplitudes for a given channel. We would greatly prefer to work with the original .mcd file for a given channel and, by using pointers, read successive amplitudes as needed. In pseudocode, this is what we would like to do:
**************************
Skip the header information in the .mcd file and point to the first voltage in the .mcd vector corresponding to channel X.
Store this value in voltage[i]
Check the interval between voltage[i] and voltage[i-1]
If this interval satisfies our condition, increment pointer to next voltage in sequence and repeat.
**************************
So rather than read the entire array of voltage values (which is quite long in our case and Matlab can't handle the length), we would need to know the file format of the .mcd files. We have looked at the MEA tools but the file that handles the .mcd data opens the entire file to memory.
Can you provide us with the number of bytes for the initial file offset as well as the byte size of each subsequent block so that we can read one piece of information (i.e., one voltage point) at a time?
Thank you.
missrd- Posts : 1
Join date : 2009-03-01
Try FIND
I would try to use FIND, which you could download at:
http://find.bccn.uni-freiburg.de/
For the current version of MC_Rack (3.7.0) you need the latest Neuroshare DLL.
Please exchange the current version 2.1 of nsMCDLibrary.dll in the FIND folder with:
http://download.multichannelsystems.com/neuroshare/nsMCDLibrary_2.2.zip
For Questions regarding the usage of Neuroshare see:
http://neuroshare.sourceforge.net/standards.shtml
and download the Neuroshare API Documentation 1.3
For questions how the channels in MCD files were mapped into Neuroshare entities see:
http://download.multichannelsystems.com/neuroshare/nsMCDLibrary_DocuV1.pdf
Then start Matlab:
And do something like this for a test:
cd 'c:\Program Files\FIND\'
[nsresult] = ns_SetLibrary('nsMCDlibrary.dll')
[nsresult,info] = ns_GetLibraryInfo()
[nsresult, hfile] = ns_OpenFile('K:\users\jp\DoubleMea.mcd')
[nsresult,info]=ns_GetFileInfo(hfile)
[nsresult,analog] = ns_GetAnalogInfo(hfile,18)
[nsresult,count,data]=ns_GetAnalogData(hfile, 18,1,344000)
plot(data)
Jens (MCS)
http://find.bccn.uni-freiburg.de/
For the current version of MC_Rack (3.7.0) you need the latest Neuroshare DLL.
Please exchange the current version 2.1 of nsMCDLibrary.dll in the FIND folder with:
http://download.multichannelsystems.com/neuroshare/nsMCDLibrary_2.2.zip
For Questions regarding the usage of Neuroshare see:
http://neuroshare.sourceforge.net/standards.shtml
and download the Neuroshare API Documentation 1.3
For questions how the channels in MCD files were mapped into Neuroshare entities see:
http://download.multichannelsystems.com/neuroshare/nsMCDLibrary_DocuV1.pdf
Then start Matlab:
And do something like this for a test:
cd 'c:\Program Files\FIND\'
[nsresult] = ns_SetLibrary('nsMCDlibrary.dll')
[nsresult,info] = ns_GetLibraryInfo()
[nsresult, hfile] = ns_OpenFile('K:\users\jp\DoubleMea.mcd')
[nsresult,info]=ns_GetFileInfo(hfile)
[nsresult,analog] = ns_GetAnalogInfo(hfile,18)
[nsresult,count,data]=ns_GetAnalogData(hfile, 18,1,344000)
plot(data)
Jens (MCS)
Similar topics
» read mcd file in Matlab
» Can I read the .mcd file using Matlab under Linux?
» Real-time spike saving
» Cardio2D+ cannot read Labbok info from settings file
» files formats
» Can I read the .mcd file using Matlab under Linux?
» Real-time spike saving
» Cardio2D+ cannot read Labbok info from settings file
» files formats
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum