Skip to content

ndi.fun.probe.import.kilosort.getInfo

  NDI.FUN.PROBE.IMPORT.KILOSORT.GETINFO - summarize the kilosort/phy output for a probe

  [INFO, SUMMARY] = NDI.FUN.PROBE.IMPORT.KILOSORT.GETINFO(S, PROBE, ...)

  Reads the curated Kilosort/Phy output directory for the probe PROBE in the
  ndi.session S and returns a summary of what is there (without importing
  anything or touching the database). This is useful for inspecting a sort
  before calling NDI.FUN.PROBE.IMPORT.KILOSORT.PROBE.

  The directory is located the same way as the importer:

        [S.path]/[kilosort_dir]/[probe_directory]/[subdir]/

    The [probe_directory] name comes from ndi.fun.file.elementDirectoryName;
    for a probe named 'ctx' with reference 1 it is 'ctx_-_1'. Folders written
    by older versions of NDI, which used a '|' separator ('ctx_|_1'), are still
    found and used if they are present.


  INFO is a structure with fields:
    directory          - the directory that was read
    num_clusters       - number of curated clusters
    cluster_ids        - vector of cluster ids
    cluster_labels     - string array of the label/tag for each cluster
    unique_tags        - string array of the distinct labels/tags present
    tag_counts         - number of clusters carrying each unique tag (parallel
                           to unique_tags)
    num_spikes_total   - total number of spikes across all clusters
    num_spikes         - vector of spike counts per cluster (parallel to cluster_ids)
    would_import       - logical vector, true for clusters whose tag is in
                           quality_labels (i.e. would be imported by default)
    num_would_import   - number of clusters that would be imported
    num_templates      - number of Kilosort templates (NaN if templates absent)
    num_channels       - number of channels in the templates (NaN if absent)
    samples_per_template - samples per template waveform (NaN if absent)
    binary_found       - true if the raw binary recording could be located (used
                           by the importer to recalculate wide mean waveforms)
    binary_file        - resolved path to the raw binary ('' if not found)
    binary_dat_path    - the raw 'dat_path' string from params.py, if any ('')
    binary_num_channels- channel count that would be used to read the binary (NaN)

  SUMMARY is a multiline character array giving a human-readable version of INFO.

  Name/value pairs (defaults match NDI.FUN.PROBE.IMPORT.KILOSORT.PROBE):
  ---------------------------------------------------------------------------------
  | Parameter (default)            | Description                                   |
  |--------------------------------|-----------------------------------------------|
  | kilosort_dir ('kilosort')      | Name of the directory holding kilosort output |
  | subdir ('kilosort_output')     | Subfolder within the probe's directory        |
  | noSubFolder (false)            | If true, read directly from the probe's dir   |
  | quality_labels (["good" "mua"])| Labels that would be imported (for would_import)|
  | binary_file ('')               | Explicit path to the raw binary; when empty it|
  |                                |   is located from the .metadata sidecar (not  |
  |                                |   params.py dat_path), for reporting.         |
  ---------------------------------------------------------------------------------

  Example:
     S = ndi.session.dir('/path/to/session');
     p = S.getprobes('type','n-trode');
     [info, summary] = ndi.fun.probe.import.kilosort.getInfo(S, p{1});
     disp(summary);

  See also: NDI.FUN.PROBE.IMPORT.KILOSORT.PROBE