-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preprocessing new TIFFs / ROIs into Spikefinder format #10
Comments
This is indeed the general outline. No the two challenges are currently not linked in this way. |
It is possible in theory though to convert the TIFFs/ROIs into a format where you can run the spikefinder algorithms, correct? Is there a recommended existing implementation for the second step (computing Δ F / F)? |
@alexklibisz The c2s function also normalizes your calcium trace, so you can basically leave out step 2 ... ... unless you have a baseline drift due to instability of the recording, especially in a behaving animal. There isn't a single best practice for computing ΔF/F0 - it depends on your experiment and the recording artifacts that you have. The recipe that you mentioned earlier is maybe not what most people do, especially the convolution with an exponential filter is giving away important information in the traces. I think that it would be best practice to subtract a time-dependent baseline (this could be a moving 5%-quantile filter window, with the window size determined heuristically, mainly depending on the timescale of the baseline drift). |
@PTRRupprecht thank you. Just to clarify, by baseline drift, do you just mean a general downward trend in the ROI values over time? In case anyone in the future might need it, below is my very amateur implementation of the steps for computing Δ F/F(t) from this figure for a Neurofinder TIFF/ROI. Certainly not guaranteed to be correct.
|
@alexklibisz "by baseline drift, do you just mean a general downward trend in the ROI values over time?" - Yes, although it could also be an upwards trend (e.g. neurons slowly dying and Calcium being released from the intracellular buffers). The implementation looks alright to me. However, you should rather set tau2 = 3 sec instead of 0.3 sec. Even 3 sec might be not long enough in some cases. For example, if you have a cell that continually fires over 10 sec, then this continuous firing would be subtracted by means of the baseline subtraction. This depends on the neurons you are looking at - some fire like crazy at all times, others only very sparsely in time. And two remarks:
Hope that helps! |
Ok thank you for the clarification and tips. It sounds like I should make the filtering step optional (I also noticed it flattens the peaks in a non-helpful way) and experiment with different values for I do have a tangential question: why is it important to know the specific number of spikes within a time window of the calcium trace rather than just knowing that there was or wasn't a spike at that time? It seems like the binary problem would be simpler, so I'm curious about the motivation. |
Hi, I am really confused how to preprocess the Calcium events. I have one file with 533 frames and 69 ROI stimuli (ST1) onset from frame =162, ST2= 301 and ST3 = 402 . I am looking for for calcium spikes. identify number of neurons which respond to each stimuli. Frame = 3.890s There is nothing for background correction so:
|
I posted a similar question on the gitter channel and @PTRRupprecht offered some tips (thanks!). Perhaps this is a better place to serialize the discussion in case others have the same question in the future. I'll preface by saying I'm fairly new to calcium imaging and completely new to spike inference. I am familiar with the Nuerofinder datasets and ROI identification/segmentation techniques.
My group would like to apply some of the Spikefinder models that were submitted and documented (here) to our own calcium imaging datasets. Our data format is identical to Neurofinder - we have a directory of 16-bit TIFFs with binary ROI masks. We're unsure of the exact steps necessary to preprocess them to work with Spikefinder models. Is there any documentation or code showing how to preprocess new TIFFs/ROIs to match the format used in the competition?
I believe the general steps we need to take are:
preprocess
function from c2s to convert to 100Hz sampling rate.I'm comfortable with steps 1 and 3, and I could likely implement step 2 as its described here, but I'm not sure if that's even the same procedure as was followed for Spikefinder.
Thanks in advance for any tips, documentation, or code examples.
The text was updated successfully, but these errors were encountered: