convert_eyetrack_EDF_to_ASCII.py 776 B

1234567891011121314151617181920212223242526
  1. """Pipeline to convert EDF to ASCII."""
  2. import logging
  3. from almirah import index
  4. from almirah import Layout
  5. from almirah import Specification
  6. from almirah.utils.convert import convert
  7. logging.basicConfig(filename="logs/convert_eyetrack_to_asc.log", level=logging.DEBUG)
  8. logging.getLogger().addHandler(logging.StreamHandler())
  9. SRC = ""
  10. DST = ""
  11. source_spec = Specification.create_from_file("configs/specifications/sourcedata.yaml")
  12. src_lay = Layout(root=SRC, specification_name="sourcedata")
  13. bids_spec = Specification.create_from_file("configs/specifications/bids.yaml")
  14. dst_lay = Layout(root=DST, specification_name="bids")
  15. src_lay.index(f"{SRC}/eyetrack")
  16. index.commit()
  17. files = src_lay.query(sourcetype="eyetrack", extension=".edf")
  18. convert(files, "ASCII", dst_lay)