kimtonyhyun / analysis

2 stars 0 forks source link

added event detector translated from python #254

Closed approbatory closed 6 years ago

approbatory commented 6 years ago

one file: detect_events.m input: FRAMES x CELLS array of traces output: FRAMES x CELLS array of binary event intervals

designed for 10Hz, can be adjusted by adjusting the parameters original

Subtracts a median filter with windowsize of 101 frames submed

Sliding average of 3 frames cleaned

detects local maxima that exceed 1.5SD for at least 5 frames, and are separated by at least 4 frames from other valid local maxima valid

sets the values from the maximum to the trough behind the maximum to 1 & offsets values backwards by 3 frames marked

kimtonyhyun commented 6 years ago

sets the values from the maximum to the trough behind the maximum to 1 & offsets values backwards by 3 frames

Do you mean the trough immediately preceding the maximum (in time)?

What's the purpose of "offsetting values backwards by 3 frames"? Also, which direction is "backwards"?

kimtonyhyun commented 6 years ago

I see that "backwards" is earlier in time. What's the motivation behind this choice?

It looks to me that the function is highly conservative with regards to transients, for example: image

But we can work on that...

approbatory commented 6 years ago

It is the trough immediately preceding the peak, i.e. the point behind the rise of the peak that is not part of the monotonic increase segment preceding the maximum.

Offsetting backwards in time (translating to the left) is from the 2013 paper where they offset due to GCaMP delay, but as you mentioned it was a different type of GCaMP so the offset may not be appropriate.