'this programm checks a waveform channel for changes in membranpotential '(EPSPs) with a certain slope. If the slope exceeds a user defined value, 'an event is writen to a memory-channel. 'Example: Find EPSPs in GM-Neurons based on slope of rise. 'Tina Eberle, Wolfgang Stein 2003 var n,yes$,slopetime,minimumslope,EPSP%,curs3,jumpsize,list%[100],i%,writetochannel,kanal; ' n hold slope of Vm ' yes$ asks user to delete memchannels ' slopetime hold the time distance for measuring the slope of Vm ' minimumslope gives the minimumslope for EPSP detection ' EPSP% is the Eventchannel ' curs3 hold the time to start measuring the slope from ' jumpsize gives the stepwidth of curs3 ' list% holds the numbers of memory Channels ' i% is used for deleting memchannels ' writechannel lets user write data to real channels ' kanal hold the number of the channel which one wants to analyze yes$:=input$("do you want to delete all memory channels (y/n)?","y",1,"yn"); 'ask user to delete memory channels if yes$="y" then 'if yes then delete all memory channels ChanList(list%[] , 20480); ' all but memory channels if (list%[0] > 0) then for i% := 1 to list%[0] do ChanDelete(list%[i%]); ' delete all memory channels next; endif; endif; 'Printlog(list%[]); EPSP%:=MemChan(2); 'create new memory channel ChanShow(EPSP%); ' and show it ChanTitle$(EPSP%,"EPSPs"); if CursorExists(1)=0 then Cursornew((xlow()+(xhigh()-xlow())/3),1) endif; if CursorExists(2)=0 then Cursornew((xlow()+(xhigh()-xlow())/2),2) endif; 'get info from user kanal:=input("what channel do you want to analyze?",7); jumpsize:=input("stepwidth of analysis (in ms)",1); jumpsize:=jumpsize/1000; slopetime:=input("time to base slope of EPSP on (in ms)",6.75); slopetime:=slopetime/1000; minimumslope:=input("minimumslope for EPSP (in mV/ms)",7); interact("Place Cursors around region to analyse",1023); curs3:=Cursor(1); 'curs3 holds the time to look for EPSPs while curs3minimumslope then ' if slope higher than threshold MemSetItem(EPSP%,0,curs3); ' write event to Memchannel curs3:=curs3+slopetime-jumpsize; ' and jump forward to end of measured area (minus stepwidth) endif; wend; 'write data to real channel writetochannel:=input("give number of channel to write to, 0 for not writing",0); if writetochannel>0 then MemSave(EPSP%,writetochannel,0); ChanShow(writetochannel); endif;