allensdk.brain_observatory.r_neuropil module¶
-
class
allensdk.brain_observatory.r_neuropil.
NeuropilSubtract
(lam=0.05, dt=1.0, folds=4)[source]¶ Bases:
object
TODO: docs
-
allensdk.brain_observatory.r_neuropil.
ab_from_diagonals
(mat_dict)[source]¶ Constructs value for scipy.linalg.solve_banded
Parameters: - mat_dict: dictionary of diagonals keyed by offsets
Returns: - ab: value for scipy.linalg.solve_banded
-
allensdk.brain_observatory.r_neuropil.
estimate_contamination_ratios
(F_M, F_N, lam=0.05, folds=4, iterations=3, r_range=[0.0, 2.0], dr=0.1, dr_factor=0.1)[source]¶ Calculates neuropil contamination of ROI
Parameters: - F_M: ROI trace
F_N: Neuropil trace
Returns: - dictionary: key-value pairs
- ‘r’: the contamination ratio – corrected trace = M - r*N
- ‘err’: RMS error
- ‘min_error’: minimum error
- ‘bounds_error’: boolean. True if error or R are outside tolerance
-
allensdk.brain_observatory.r_neuropil.
get_diagonals_from_sparse
(mat)[source]¶ Returns a dictionary of diagonals keyed by offsets
Parameters: - mat: scipy.sparse matrix
Returns: - dictionary: diagonals keyed by offsets