Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

__init__.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. # -*- coding: utf-8 -*-
  2. """
  3. :mod:`neo.io` provides classes for reading and/or writing
  4. electrophysiological data files.
  5. Note that if the package dependency is not satisfied for one io, it does not
  6. raise an error but a warning.
  7. neo.io.iolist provides a list of succesfully imported io classes.
  8. Classes:
  9. .. autoclass:: neo.io.AlphaOmegaIO
  10. .. autoclass:: neo.io.AsciiSignalIO
  11. .. autoclass:: neo.io.AsciiSpikeTrainIO
  12. .. autoclass:: neo.io.AxonIO
  13. .. autoclass:: neo.io.BlackrockIO
  14. .. autoclass:: neo.io.BrainVisionIO
  15. .. autoclass:: neo.io.BrainwareDamIO
  16. .. autoclass:: neo.io.BrainwareF32IO
  17. .. autoclass:: neo.io.BrainwareSrcIO
  18. .. autoclass:: neo.io.ElanIO
  19. .. autoclass:: neo.io.ElphyIO
  20. .. autoclass:: neo.io.IgorIO
  21. .. autoclass:: neo.io.KlustaKwikIO
  22. .. autoclass:: neo.io.KwikIO
  23. .. autoclass:: neo.io.MicromedIO
  24. .. autoclass:: neo.io.NeoHdf5IO
  25. .. autoclass:: neo.io.NeoMatlabIO
  26. .. autoclass:: neo.io.NestIO
  27. .. autoclass:: neo.io.NeuralynxIO
  28. .. autoclass:: neo.io.NeuroExplorerIO
  29. .. autoclass:: neo.io.NeuroScopeIO
  30. .. autoclass:: neo.io.NeuroshareIO
  31. .. autoclass:: neo.io.NixIO
  32. .. autoclass:: neo.io.NSDFIO
  33. .. autoclass:: neo.io.PickleIO
  34. .. autoclass:: neo.io.PlexonIO
  35. .. autoclass:: neo.io.PyNNNumpyIO
  36. .. autoclass:: neo.io.PyNNTextIO
  37. .. autoclass:: neo.io.RawBinarySignalIO
  38. .. autoclass:: neo.io.StimfitIO
  39. .. autoclass:: neo.io.TdtIO
  40. .. autoclass:: neo.io.WinEdrIO
  41. .. autoclass:: neo.io.WinWcpIO
  42. """
  43. import os.path
  44. #try to import the neuroshare library.
  45. #if it is present, use the neuroshareapiio to load neuroshare files
  46. #if it is not present, use the neurosharectypesio to load files
  47. try:
  48. import neuroshare as ns
  49. except ImportError as err:
  50. from neo.io.neurosharectypesio import NeurosharectypesIO as NeuroshareIO
  51. #print("\n neuroshare library not found, loading data with ctypes" )
  52. #print("\n to use the API be sure to install the library found at:")
  53. #print("\n www.http://pythonhosted.org/neuroshare/")
  54. else:
  55. from neo.io.neuroshareapiio import NeuroshareapiIO as NeuroshareIO
  56. #print("neuroshare library successfully imported")
  57. #print("\n loading with API...")
  58. from neo.io.alphaomegaio import AlphaOmegaIO
  59. from neo.io.asciisignalio import AsciiSignalIO
  60. from neo.io.asciispiketrainio import AsciiSpikeTrainIO
  61. from neo.io.axonio import AxonIO
  62. from neo.io.blackrockio import BlackrockIO
  63. from neo.io.brainvisionio import BrainVisionIO
  64. from neo.io.brainwaredamio import BrainwareDamIO
  65. from neo.io.brainwaref32io import BrainwareF32IO
  66. from neo.io.brainwaresrcio import BrainwareSrcIO
  67. from neo.io.elanio import ElanIO
  68. #from neo.io.elphyio import ElphyIO
  69. from neo.io.exampleio import ExampleIO
  70. from neo.io.igorproio import IgorIO
  71. from neo.io.klustakwikio import KlustaKwikIO
  72. from neo.io.kwikio import KwikIO
  73. from neo.io.micromedio import MicromedIO
  74. from neo.io.hdf5io import NeoHdf5IO
  75. from neo.io.neomatlabio import NeoMatlabIO
  76. from neo.io.nestio import NestIO
  77. from neo.io.neuralynxio import NeuralynxIO
  78. from neo.io.neuroexplorerio import NeuroExplorerIO
  79. from neo.io.neuroscopeio import NeuroScopeIO
  80. from neo.io.nixio import NixIO
  81. from neo.io.nsdfio import NSDFIO
  82. from neo.io.pickleio import PickleIO
  83. from neo.io.plexonio import PlexonIO
  84. from neo.io.pynnio import PyNNNumpyIO
  85. from neo.io.pynnio import PyNNTextIO
  86. from neo.io.rawbinarysignalio import RawBinarySignalIO
  87. from neo.io.spike2io import Spike2IO
  88. from neo.io.stimfitio import StimfitIO
  89. from neo.io.tdtio import TdtIO
  90. from neo.io.winedrio import WinEdrIO
  91. from neo.io.winwcpio import WinWcpIO
  92. iolist = [
  93. AlphaOmegaIO,
  94. AsciiSignalIO,
  95. AsciiSpikeTrainIO,
  96. AxonIO,
  97. BlackrockIO,
  98. BrainVisionIO,
  99. BrainwareDamIO,
  100. BrainwareF32IO,
  101. BrainwareSrcIO,
  102. ElanIO,
  103. #ElphyIO,
  104. ExampleIO,
  105. IgorIO,
  106. KlustaKwikIO,
  107. KwikIO,
  108. MicromedIO,
  109. NixIO, # place NixIO before NeoHdf5IO to make it the default for .h5 files
  110. NeoHdf5IO,
  111. NeoMatlabIO,
  112. NestIO,
  113. NeuralynxIO,
  114. NeuroExplorerIO,
  115. NeuroScopeIO,
  116. NeuroshareIO,
  117. NSDFIO,
  118. PickleIO,
  119. PlexonIO,
  120. PyNNNumpyIO,
  121. PyNNTextIO,
  122. RawBinarySignalIO,
  123. Spike2IO,
  124. StimfitIO,
  125. TdtIO,
  126. WinEdrIO,
  127. WinWcpIO
  128. ]
  129. def get_io(filename, *args, **kwargs):
  130. """
  131. Return a Neo IO instance, guessing the type based on the filename suffix.
  132. """
  133. extension = os.path.splitext(filename)[1][1:]
  134. for io in iolist:
  135. if extension in io.extensions:
  136. return io(filename, *args, **kwargs)
  137. raise IOError("File extension %s not registered" % extension)