neuralynxio.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. """
  2. Class for reading data from Neuralynx files.
  3. This IO supports NCS, NEV and NSE file formats.
  4. Depends on: numpy
  5. Supported: Read
  6. Author: Julia Sprenger, Carlos Canova
  7. """
  8. from neo.io.basefromrawio import BaseFromRaw
  9. from neo.rawio.neuralynxrawio import NeuralynxRawIO
  10. class NeuralynxIO(NeuralynxRawIO, BaseFromRaw):
  11. """
  12. Class for reading data from Neuralynx files.
  13. This IO supports NCS, NEV, NSE and NTT file formats.
  14. NCS contains signals for one channel
  15. NEV contains events
  16. NSE contains spikes and waveforms for mono electrodes
  17. NTT contains spikes and waveforms for tetrodes
  18. """
  19. _prefered_signal_group_mode = 'group-by-same-units'
  20. mode = 'dir'
  21. def __init__(self, dirname, use_cache=False, cache_path='same_as_resource',
  22. keep_original_times=False):
  23. """
  24. Initialise IO instance
  25. Parameters
  26. ----------
  27. dirname : str
  28. Directory containing data files
  29. use_cache : bool, optional
  30. Cache results of initial file scans for faster loading in subsequent runs.
  31. Default: False
  32. cache_path : str, optional
  33. Folder path to use for cache files.
  34. Default: 'same_as_resource'
  35. keep_original_times : bool
  36. Preserve original time stamps as in data files. By default datasets are
  37. shifted to begin at t_start = 0*pq.second.
  38. Default: False
  39. """
  40. NeuralynxRawIO.__init__(self, dirname=dirname, use_cache=use_cache,
  41. cache_path=cache_path, keep_original_times=keep_original_times)
  42. BaseFromRaw.__init__(self, dirname)