<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Robert,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for your answer. Actually I’m  working with a dataformat which is currently not supported (Sonfiles, .smr), but it is possible to access and export the data in various timeformats (including clockticks, microseconds etc.) using functions from the SON-library provided by SigTOOL. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Now  I would like to know whether I can simply create my own raw data structure for further analysis using functions from the spike-toolbox or do ft_spike functions still deal with different timecode-formats once the raw data has been read into memory (so how should the (raw) spike data be represented if no fileformat is specified)? <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Here’s just an example of my import procedure:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>fid = fopen(</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A020F0'>‘filename.smr'</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>); </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%open file and return filehandle</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>info_tmp = SONChanList(fid); </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%get channelinformation</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>spike = [];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>kind = reshape({info_tmp.kind},size({info_tmp.kind},2),1); </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%find units and LFP</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'> </span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>if</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> any(cell2mat(kind(:)) == 6) == 0</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    error(</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A020F0'>'no spike channels detected'</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>)</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>end</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%find indices and names of spikechannels</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%kind = 1 -> waveform, kind = 6 -> wavemark (spikes)</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'> </span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>[wvmk] = find((cell2mat({info_tmp.kind})) == 6); </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%get index of wavemarkchannels</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>spikechan = [info_tmp(wvmk)]; </span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>spike.label = reshape({spikechan.title},size({spikechan.title},2),1);</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>sident = [spikechan.number];</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%import channeldata</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'> </span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>for</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> i = 1:length(sident)</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    n = sident(i);</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    tmp =  [SONGetChannel(fid,n,</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A020F0'>'ticks'</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>)]; </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%export as clockticks</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    spike.timestamp{1,i} = reshape([tmp.timings],1,size([tmp.timings],1)); </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%index (clockticks) of first spike-sample</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    spike.waveform{1,i}(1,:,:) = double(tmp.adc)*1/6553.6; </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%10 V range; 16 bit int units to double (1x 32 datapoints per sike x timestamps)</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%create channelheader:</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%samplinginterval in Hz</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    spike.hdr.Fs{1,i} = 1/(SONGetSampleInterval(fid,sident)*1e-6);</span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>    spike.hdr.label{1,i} = {spikechan.title(i)}; </span><span lang=EN-US style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>end</span><span style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>So in this case spikes are just represented by their clocktick-indices as well as the rest of the data. Since I know the sampling rate and the index of the first spike-datapoint (which would be similar to the timestamppersample field in the tutorials) it should be easy to synchronize them with the continuous LFP data. I assume that all the required fields are present in my spike structure but I am unsure about how fieldtrip functions deal with my timestamp representation.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks and best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dominic<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> fieldtrip-bounces@science.ru.nl [mailto:fieldtrip-bounces@science.ru.nl] <b>Im Auftrag von </b>Robert Oostenveld<br><b>Gesendet:</b> Mittwoch, 5. November 2014 19:30<br><b>An:</b> FieldTrip discussion list<br><b>Betreff:</b> Re: [FieldTrip] Timestamp format using ft_spike functions<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hi Dominic,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Timestamps are encoded in the original representation of the corresponding acquisition system. For Plexon that means that they are at 40kHz, for Neuralynx they are approximately 1MHz. This allows the different types of data acquired with the system (spikes, LFP, events) to be synchronized. <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>best regards,<o:p></o:p></p></div><div><p class=MsoNormal>Robert<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On 31 Oct 2014, at 16:47, Dominic Depke <<a href="mailto:dominic.depke@ruhr-uni-bochum.de">dominic.depke@ruhr-uni-bochum.de</a>> wrote:<o:p></o:p></p></div><p class=MsoNormal><br><br><o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Dear all,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>I have a question regarding the data structure of spikedata.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Thanks and best wishes,</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Dominic</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>Dominic Depke, M.Sc.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>PhD student</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Institut für Physiologie I</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Robert-Koch-Straße 27a</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>DE-48149 Münster</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Tel. : +49 251-83-58112</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Email:<span class=apple-converted-space> </span><a href="mailto:depke@uni-muenster.de">depke@uni-muenster.de</a></span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> <o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl"><span style='color:purple'>fieldtrip@donders.ru.nl</span></a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip"><span style='color:purple'>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</span></a><o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>