Skip to content
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

err: NaN during re-estimation step #123

Closed
naomixia opened this issue Jun 19, 2018 · 12 comments
Closed

err: NaN during re-estimation step #123

naomixia opened this issue Jun 19, 2018 · 12 comments

Comments

@naomixia
Copy link

Hello!

I'm having issues with diam <4 cases where during the cell mask re-estimation step the err becomes NaN. The same data set run with diam >= 5 does not have this problem, but this parameter setting causes under-detection of cells. Any help would be appreciated!

skipping registration, but assembling binary file
Set 1, tiff 1 done in time 38.11
517 total ROIs, err 1.7088, thresh 0.2315
886 total ROIs, err 1.1489, thresh 0.2315
1160 total ROIs, err 0.8322, thresh 0.2315
1361 total ROIs, err 0.6894, thresh 0.2315
1495 total ROIs, err 0.6454, thresh 0.2315
1573 total ROIs, err 0.6297, thresh 0.2315
1617 total ROIs, err 0.6231, thresh 0.2315
1617 total ROIs, err NaN, thresh 0.2315
1617 total ROIs, err NaN, thresh 0.2315
1617 total ROIs, err NaN, thresh 0.2315
Frame 6000 done in time 2.90
Frame 12000 done in time 5.83
Frame 15000 done in time 7.33
Error using bsxfun
Non-singleton dimensions of the two input arrays must match each other.

Error in svdecon (line 36)
V = bsxfun(@(x,c)x./c, V, s');

Error in extractSignalsSurroundNeuropil2 (line 97)
[u, s, v] = svdecon(ratCS);

Error in run_pipeline (line 78)
[ops, stat, Fcell, FcellNeu] = extractSignalsSurroundNeuropil2(ops, stat);

@carsen-stringer
Copy link
Collaborator

Have you downloaded the latest version of the code? This chunk of code is just for zdrift estimation, there's an option ops.Zdrift that is set to 0 by default. Are you setting it to 1?

@carsen-stringer
Copy link
Collaborator

Sorry it's ops.getZdrift that should be set to zero by default

@naomixia
Copy link
Author

naomixia commented Jun 19, 2018 via email

@carsen-stringer
Copy link
Collaborator

Oh sorry I misunderstood your problem when it runs to the end what are the stat(k).radius? We estimate the cell radius by fitting an ellipse to the cell pixels and I'm thinking that it might be too small and we should add a default minimum value (the neuropil masks scale with the radius of the cell)

@naomixia
Copy link
Author

naomixia commented Jun 19, 2018 via email

@carsen-stringer
Copy link
Collaborator

Alright I set the minimum radius to 3 pixels (it's computed in createCellMasks.m) try pulling the new code running it now and see if the neuropil looks reasonable (and if things don't go NaN).

@naomixia
Copy link
Author

Hello! I attempted it but It's still going to NaN. I noticed that my stat.ipix was also empty, and wondering if this caused createCellMasks.m to not enter the loop for the minimum radius code in line 22?

@carsen-stringer
Copy link
Collaborator

Even without SourceryAddOn the cells have no pixels?

@naomixia
Copy link
Author

I think it always works without SourceryAddOn. I just re-ran it with min=3 but I'm not certain the output is different from before.

@carsen-stringer
Copy link
Collaborator

SourceryAddOn reduces the sizes of the ROIs, which may reduce your ROIs to zero pixels if they are very small. You can run it with this turned on, but you will probably lose some of your ROIs (anything with ipix=0 will not have any signals extracted). But does running without SourceryAddOn and with min=3 return non-NaN neuropil?

@naomixia
Copy link
Author

naomixia commented Jun 19, 2018 via email

@carsen-stringer
Copy link
Collaborator

I've added in an option (ops.refine, default is 1). If ops.refine=1, then sourceryAddOn.m runs, if ops.refine=0, then it won't refine. Please reopen this issue if you're still having problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants