Skip to content

Commit

Permalink
fixed CNMF-E and components evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
agiovann committed Dec 2, 2017
1 parent 02ef924 commit 65394c4
Show file tree
Hide file tree
Showing 5 changed files with 789 additions and 17 deletions.
10 changes: 6 additions & 4 deletions caiman/components_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ def evaluate_components_placeholder(params):

#%%
def estimate_components_quality_auto(Y, A, C, b, f, YrA, frate, decay_time, gSig, dims, dview = None, min_SNR=2, r_values_min = 0.9,
r_values_lowest = 0.2, Npeaks = 10, use_cnn = True, thresh_cnn_min = 0.95, thresh_cnn_lowest = 0.1,
thresh_fitness_delta = -80.):
r_values_lowest = -1, Npeaks = 10, use_cnn = True, thresh_cnn_min = 0.95, thresh_cnn_lowest = 0.1,
thresh_fitness_delta = -20., min_std_reject = 0.5):

''' estimates the quality of component automatically
Expand Down Expand Up @@ -449,7 +449,9 @@ def estimate_components_quality_auto(Y, A, C, b, f, YrA, frate, decay_time, gSig
thresh_cnn_lowest:
all samples with probabilities smaller than this are rejected
min_std_reject:
adaptive way to set threshold (like min_SNR but used to discard components with std lower than this value)
Returns:
--------
Expand All @@ -473,7 +475,7 @@ def estimate_components_quality_auto(Y, A, C, b, f, YrA, frate, decay_time, gSig
thresh_fitness_raw = scipy.special.log_ndtr(-min_SNR)*N_samples # inclusion probability of noise transient

fitness_min = scipy.special.log_ndtr(-min_SNR)*N_samples # threshold on time variability
thresh_fitness_raw_reject = scipy.special.log_ndtr(-0.5)*N_samples # components with SNR lower than 0.5 will be rejected
thresh_fitness_raw_reject = scipy.special.log_ndtr(-min_std_reject)*N_samples # components with SNR lower than 0.5 will be rejected
traces = C + YrA

_, _ , fitness_raw, fitness_delta, r_values = estimate_components_quality(
Expand Down
Loading

0 comments on commit 65394c4

Please sign in to comment.