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.

Import MC_Rack files into Matlab

Go down

Import MC_Rack files into Matlab Empty Import MC_Rack files into Matlab

Post  mcs Thu Jun 12, 2008 4:01 pm

Is there anyone who knows an easy way to import/read MC-rack files into Matlab without using the Meatools???

mcs

Posts : 518
Join date : 2008-06-10

Back to top Go down

Import MC_Rack files into Matlab Empty Re: Import MC_Rack files into Matlab

Post  mcs Thu Jun 12, 2008 4:02 pm

You should take a look at Data Access Pro from Bruxton Corp.

mcs

Posts : 518
Join date : 2008-06-10

Back to top Go down

Import MC_Rack files into Matlab Empty Re: Import MC_Rack files into Matlab

Post  mcs Thu Jun 12, 2008 4:02 pm

To import mcd files into Matlab you can use the
matlab funktions located in the subdirectory:

MCStreamSupport\Matlab\meatools\mcintfac\@datastrm

To open a file
file = datastrm('mcrackdata.mcd')

To read in the data

data = nextdata(file,'startend',StartStopVector,'streamname','Spikes 1');

You can read data chunks of variable size using 'startend'.
Select a data stream using the parameter 'streamname','Spikes 1'.
The nextdata routine fills the data array with the data arraged in channels.

A disadvantage are the spacely documented m files.

mcs

Posts : 518
Join date : 2008-06-10

Back to top Go down

Import MC_Rack files into Matlab Empty Re: Import MC_Rack files into Matlab

Post  mcs Thu Jun 12, 2008 4:02 pm

I have a slightly different question.

I am trying to extract the spike detection thresholds from old racks. Yes I used to save the racks (*.rck) for each experiment, in order to keep track of each threshold for each electrode. However, now I am not able to open old racks in MCRack. Is there someway I can retrieve this information (i.e. read .rck files as text?)? (currently I calculate the thresholds by finding the mean voltage value at the threshold crossing (1ms) from the spike cutouts)

In some version upgrade you mentioned that the spike threshold would be saved with the .mcd files. For those newer files, what is the field name to get (with getfield in matlab)?

Thank you,
Walid

mcs

Posts : 518
Join date : 2008-06-10

Back to top Go down

Import MC_Rack files into Matlab Empty Re: Import MC_Rack files into Matlab

Post  mcs Thu Jun 12, 2008 4:03 pm

Extracting threshold levels using Matlab

The threshold levels used to detect spikes are saved in the mcd files. You can read this data by accessing the StreamInfo field
generated when opening the file. Follow the steps below to access
spike relevant information.


// open file
>> file = datastrm('8channelMCDfile.mcd')

// check which field contains the spike data
>> x = getfield(file,'StreamNames')
x =
'Spikes 1'
'Filtered Data 1'


// retriev spike info (which is the first field in this example)
>> SpikeInfo = getfield(file,'StreamInfo',{1})

// check the field
>> SpikeInfo{1}
ans =
StreamName: 'Spikes 1'
DataType: 'spikes'
PreTrigger: 1.0000e-003
PostTrigger: 0.0020
DeadTime: 0.0020
Level: <1x8 double>
Slope: <1 1 1 1 1 1 1 1>
ChannelNames: {1x8 cell}

// access threshold levels of all channels
>> SpikeInfo{1}.Level

ans =
1.0e-003 *
Columns 1 through 8
-0.1200 -0.1200 -0.1200 -0.1200 -0.1200 -0.1200 -0.1200 -0.1200


//access the associated channel names
>> spikeinfo{1}.ChannelNames
ans =
Columns 1 through 8
'14' '15' '16' '17' '28' '38' '45' '48'



You can combine the levels with the ChannelNames.

mcs

Posts : 518
Join date : 2008-06-10

Back to top Go down

Import MC_Rack files into Matlab Empty Re: Import MC_Rack files into Matlab

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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