Welcome to our user forum (read only mode).
Would you like to react to this message? Create an account in a few clicks or log in to continue.

how to read portion of .mcd file

2 posters

Go down

how to read portion of .mcd file Empty how to read portion of .mcd file

Post  missrd Thu Mar 05, 2009 4:53 am

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.

missrd

Posts : 1
Join date : 2009-03-01

Back to top Go down

how to read portion of .mcd file Empty Try FIND

Post  Jens Fri Mar 06, 2009 10:40 am

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)

Jens

Posts : 55
Join date : 2009-03-06
Location : Multi Channel Systems

http://www.multichannelsystems.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum