-
Notifications
You must be signed in to change notification settings - Fork 27
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
Clarification on spatialr and se #57
Comments
Hi Gavin, Yes your understanding is correct. However, between the two options you mentioned, the latter is slightly preferred, but in practice, I would use either spatialr = 0.5 and se = 4, or spatialr = 0.75 and se = 5. So the logic here is 1. whenever you can, it would be better to downsample the video so you will have a much shorter running time; 2. se should be >= 3, and >3 when it is possible; 3. the selection of se contains some flexibility, for example, in your case without downsampling, it would be okay to use se from any integer within [4, 6], therefore even when you downsample, you can still choose a slightly larger se to avoid structure element degeneration (< 3). |
Great, thanks again Jinghao! |
Hi Jinghao, Is it possible to run min1pipe with no spatial downsampling (spatialr=1) if the running time is not a concern? Somewhere in your comments, I read that in theory for spatialr=1, se should be equal to 10. But based on your comment above it looks like se should be within [4,6]. My cells are usually 20-25 pixels so maybe se=5 is OK? Thanks very much, |
Hi @ElhamGhanbarian, yes it is possible to run the code with no spatial downsampling, but in theory no spatial downsampling + large se is the same as spatial downsampling + small se, so why not using quadratically faster option. Plus with a spatial downsampling, you get those small background noise largely removed from the beginning and the algorithm can naturally focus more on the neuron ROIs. Ideally se should be within [3, 7] and the spatialr can be adjusted accordingly. If spatialr = 1 and your cells are 20-25 pixels, then you have to use se = [10, 12]. |
Hi, |
Hi @ElhamGhanbarian, the bottom line is you use the typical neuronal radius in pixel as se, and if se is too big, it means you have the wiggle room to spatially downsample the video so that se falls [4, 6]. In your case, since you want to keep as much info as possible, the cutoff radius in pixel you should look at is 10 indeed, therefore se=5 with spatialr=1. |
Thanks, Jinghao. The problem is that without downsampling it takes more than 15 hours and then usually an error happens. The most recent error that I got was the 'out of memory error' although I have 160GB of RAM and I cropped the original movie to keep the main ROI. So I think downsampling is critical for the algorithm. |
@ElhamGhanbarian You are right, so in your case at least you can try spatialr=0.5 and se=3 or 4. It probably is the graphical memory that is limiting the running but not RAM by the way. |
Hi Jinghao,
I just wanted to doublecheck that I properly understand how these input parameters work.
I have some miniscope recordings (V4 UCLA miniscope; Labmaker) in which I have measured the mean cell cell radius to be about 5.5 pixels with no downsampling. The way I understand the script and accompanying documentation, the cell size input parameter is a structure element with cell radius in pixels (AFTER spatial downsampling) as the input argument. So when I'm analyzing these recordings in min1pipe, I have been using either 1) spatialr = 1 and se = 5 (or 6), or; 2) spatialr = 0.5 and se = 3.
Could you confirm whether or not this is correct?
Thanks very much!
Gavin
The text was updated successfully, but these errors were encountered: