how to read portion of .mcd file

View previous topic View next topic Go down

how to read portion of .mcd file

Post  missrd on Wed Mar 04, 2009 4:53 pm


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.


Posts : 1
Join date : 2009-02-28

View user profile

Back to top Go down


Post  Jens on Thu Mar 05, 2009 10:40 pm

I would try to use FIND, which you could download at:

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:

For Questions regarding the usage of Neuroshare see:
and download the Neuroshare API Documentation 1.3

For questions how the channels in MCD files were mapped into Neuroshare entities see:

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\')
[nsresult,analog] = ns_GetAnalogInfo(hfile,18)
[nsresult,count,data]=ns_GetAnalogData(hfile, 18,1,344000)

Jens (MCS)


Posts : 54
Join date : 2009-03-05
Location : Multi Channel Systems

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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