pyNAVIS.splitters

Splitters

class pyNAVIS.splitters.Splitters[source]

Methods:

automatic_splitter(spikes_file, ...[, ...])

Generate a set of files from the one received as input based on the silences in between words/sounds.

manual_splitter(spikes_file, settings, init)

Extract a portion of the input SpikesFile file.

segmenter_RT(spikes_file, noise_threshold, ...)

Removes background noise.

static automatic_splitter(spikes_file, noise_threshold, bin_width, path, settings, output_format='.aedat')[source]

Generate a set of files from the one received as input based on the silences in between words/sounds. This function uses segmenter_RT. NOTE: more tests needed to confirm that it works in any case.

Parameters:
  • spikes_file (SpikesFile) – Input file.

  • noise_threshold (int) – Size of the FIFO.

  • bin_width (int) – Time difference (in ms).

  • path (string) – Path where the output files will be saved. Format should not be specified.

  • settings (MainSettings, optional) – Configuration parameters for the output file. Only needed when saving the output as an AEDAT file.

  • output_format (string, optional) – Output format of the file. Currently supports ‘.aedat’, ‘.csv’, “.txt” and “.txt_rel”. See the Savers class for more information.

Returns:

None.

static manual_splitter(spikes_file, settings, init, end=-1, return_save_both=0, output_format='.aedat', path=None)[source]

Extract a portion of the input SpikesFile file.

Parameters:
  • spikes_file (SpikesFile) – Input file.

  • init (int) – First timestamp from which to start extracting.

  • end (int) – Last timestamp from which to stop extracting.

  • settings (MainSettings) – Configuration parameters for the input file.

  • return_save_both (int, optional) – Set it to 0 to return the resultant SpikesFile, to 1 to save the SpikesFile in the output path, and to 2 to do both.

  • output_format (string, optional) – Output format of the file. Currently supports ‘.aedat’, ‘.csv’, “.txt” and “.txt_rel”. See the Savers class for more information.

  • path (string, optional) – Path where the output file will be saved. Format should not be specified. Not needed if return_save_both is set to 0.

Returns:

SpikesFile – SpikesFile containing the extracted portion of the input file. Returned only if return_save_both is either 0 or 2.

static segmenter_RT(spikes_file, noise_threshold, bin_width, return_save_both=0, output_format='.aedat', path=None, settings=None, verbose=False)[source]

Removes background noise.

A FIFO of size noise_threshold will be filling up with every spike. If the timestamp difference between the first and the last spike in the FIFO is lower or equal than bin_width, then the most recent spike is saved.

Parameters:
  • spikes_file (SpikesFile) – Input file.

  • noise_threshold (int) – Size of the FIFO.

  • bin_width (int) – Time difference (in ms).

  • return_save_both (int, optional) – Set it to 0 to return the resultant SpikesFile, to 1 to save the SpikesFile in the output path, and to 2 to do both.

  • output_format (string, optional) – Output format of the file. Currently supports ‘.aedat’, ‘.csv’, “.txt” and “.txt_rel”. See the Savers class for more information.

  • path (string, optional) – Path where the output file will be saved. Format should not be specified. Not needed if return_save_both is set to 0.

  • settings (MainSettings, optional) – Configuration parameters for the output file. Only needed when saving the output as an AEDAT file.

  • verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.

Returns:

SpikesFile – SpikesFile containing the processed input file. Returned only if return_save_both is either 0 or 2.