Skip to content

ndi.fun.ensemble.neuronQuality

  ndi.fun.ensemble.neuronQuality - look up the quality of an ensemble's neurons

  [QUALITY_NUMBER, QUALITY_LABEL] = ndi.fun.ensemble.NEURONQUALITY(S, NEURON_IDS)

  For each neuron element id in NEURON_IDS (e.g. the ids returned by
  ndi.fun.ensemble.read), looks up its 'neuron_extracellular' document in the
  ndi.session (or ndi.dataset) S and returns the recorded spike-sorting quality.

  QUALITY_NUMBER is a 1-by-N double: QUALITY_NUMBER(i) is the quality_number of
  NEURON_IDS{i}, or NaN if that neuron has no neuron_extracellular document.
  QUALITY_LABEL is a 1-by-N cell array of the corresponding quality_label
  strings ('' where there is no document).

  The lookup is done with a single database search for the neuron_extracellular
  documents, which are then matched to NEURON_IDS by their element_id
  dependency (rather than one query per neuron). If a neuron has more than one
  neuron_extracellular document, an error is raised.

  =========================================================================
  EXAMPLE
  =========================================================================
    E = ndi.fun.ensemble.read(S, ens, 'epoch_1');
    [qnum, qlabel] = ndi.fun.ensemble.neuronQuality(S, E.neuron_ids);
    good = E.neuron_ids(qnum >= 2);   % neurons with quality_number at least 2

  See also: ndi.fun.ensemble.read, ndi.fun.ensemble.filter