{ "info": { "author": "Justus Schwabedal, Wayne Manselle", "author_email": "jschwabedal@belco.tech, wayne.manselle@belco.tech", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Introduction\n\n[![Build Status](https://semaphoreci.com/api/v1/projects/be4f860e-7b26-45b2-9513-91f75c8081b5/2475430/badge.svg)](https://semaphoreci.com/bel-co/mffpy)\n\n`mffpy` is a lean reader for EGI's MFF file format. These files are\ndirectories containing several files of mostly xml files, but also binary\nfiles.\n\nThe main entry point into the library is class `Reader` that accesses a\nselection of functions in the .mff directory to return signal data and its meta\ninformation.\n\n## Installation\n\n```bash\n$ conda create -n mffpy python=3.6 pip\n$ conda activate mffpy\n$ pip install -r requirements.txt\n$ python setup.py install\n$ # and to run the test\n$ make test\n```\n\n## Contribute\n\nDefinitely run:\n```bash\n$ pip install pre-commit\n$ pre-commit install\n```\n\n### Test Coverage\n\n```\nName Stmts Miss Cover\n-------------------------------------------------------\nmffpy/__init__.py 2 0 100%\nmffpy/bin_files.py 40 8 80%\nmffpy/bin_writer.py 47 7 85%\nmffpy/devices.py 10 0 100%\nmffpy/dict2xml.py 31 3 90%\nmffpy/epoch.py 23 5 78%\nmffpy/header_block.py 49 1 98%\nmffpy/mffdir.py 92 18 80%\nmffpy/raw_bin_files.py 95 0 100%\nmffpy/reader.py 57 2 96%\nmffpy/tests/__init__.py 0 0 100%\nmffpy/tests/test_devices.py 12 0 100%\nmffpy/tests/test_dict2xml.py 15 0 100%\nmffpy/tests/test_header_block.py 37 0 100%\nmffpy/tests/test_mffdir.py 30 0 100%\nmffpy/tests/test_raw_bin_files.py 33 0 100%\nmffpy/tests/test_reader.py 26 0 100%\nmffpy/tests/test_writer.py 50 2 96%\nmffpy/tests/test_xml_files.py 130 1 99%\nmffpy/tests/test_zipfile.py 34 0 100%\nmffpy/writer.py 51 2 96%\nmffpy/xml_files.py 325 8 98%\nmffpy/zipfile.py 45 0 100%\n-------------------------------------------------------\nTOTAL 1234 57 95%\n```\n\n## View the Docs\n\nAll documentation and API guidance are generated from the python doc-strings\nand this README file using pydoc-markdown. To view the docs:\n\n* install pydoc-markdown: `pip install pydoc-markdown`\n* build and run: `pydocmd build; pydocmd serve`\n* Navigate to the [docs](http://localhost:8000)\n\n## Example Code\n\n### Example 1: Basic Information\n\n```python\nimport mffpy\nfo = mffpy.Reader(\"./examples/example_1.mff\")\nprint(\"time and date of the start of recording:\", fo.startdatetime)\nprint(\"number of channels:\", fo.num_channels)\nprint(\"sampling rates:\", fo.sampling_rates, \"(in Hz)\")\nprint(\"durations:\", fo.durations, \"(in sec.)\")\nprint(\"Here's the epoch information\")\nfor i, e in enumerate(fo.epochs):\n print(\"Epoch number\", i)\n print(e)\n```\n\n### Example 2: Reading Samples\n\n```python\nfrom mffpy import Reader\nfo = Reader(\"./examples/example_1.mff\")\nfo.set_unit('EEG', 'uV')\neeg_in_mV, t0_EEG = fo.get_physical_samples_from_epoch(fo.epochs[0], dt=0.1)['EEG']\nfo.set_unit('EEG', 'V')\neeg_in_V, t0_EEG = fo.get_physical_samples_from_epoch(fo.epochs[0], dt=0.1)['EEG']\nprint('data in mV:', eeg_in_mV[0])\nprint('data in V :', eeg_in_V[0])\n```\n\n### Example 3: Reading .mff xml files\n\n```python\nfrom mffpy import XML\ncategories = XML.from_file(\"./examples/example_1.mff/categories.xml\")\nprint(categories['ULRN'])\n```\n\n### Example 4: Writing random numbers into an .mff file\n\n```python\nfrom os.path import join\nfrom datetime import datetime\nimport numpy as np\nfrom mffpy import Reader\nfrom mffpy.writer import *\n\n# write 256 channels of 10 data points at a sampling rate of 128 Hz\nB = BinWriter(sampling_rate=128)\nB.add_block(np.random.randn(256, 10).astype(np.float32))\nW = Writer(join('examples', 'my_new_file.mff'))\nstartdatetime = datetime.strptime('1984-02-18T14:00:10.000000+0100',\n \"%Y-%m-%dT%H:%M:%S.%f%z\")\nW.addxml('fileInfo', recordTime=startdatetime)\nW.add_coordinates_and_sensor_layout(device='HydroCel GSN 256 1.0')\nW.addbin(B)\nW.write()\n```\n\n## License and Copyright\n\nCopyright 2019 Brain Electrophysiology Laboratory Company LLC\n\nLicensed under the ApacheLicense, Version 2.0(the \"License\");\nyou may not use this module except in compliance with the License.\nYou may obtain a copy of the License at:\n\nhttp: // www.apache.org / licenses / LICENSE - 2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\nANY KIND, either express or implied.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "Justus Schwabedal", "maintainer_email": "jschwabedal@belco.tech", "name": "mffpy", "package_url": "https://pypi.org/project/mffpy/", "platform": "", "project_url": "https://pypi.org/project/mffpy/", "project_urls": null, "release_url": "https://pypi.org/project/mffpy/0.3.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Reader and Writer for Philips' MFF file format.", "version": "0.3.0" }, "last_serial": 5887614, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "76ae8820078f837e86ed7e3e739b42b2", "sha256": "cec000d6d161a882730a451c2749871014af5a0f7b692080ee69b6e878681d8f" }, "downloads": -1, "filename": "mffpy-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "76ae8820078f837e86ed7e3e739b42b2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 131974, "upload_time": "2019-09-25T23:26:34", "url": "https://files.pythonhosted.org/packages/c0/f5/7b0bbf4ae4ef27adde2f39b8cdab928d1b8049d98769fb76200ce5ad5887/mffpy-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c229d2715313509a4c9a354ea03c8fb9", "sha256": "2c6aaa47e3da453237efceb9561f3ab9386fd2039e2c84afac84a5f1763bae2a" }, "downloads": -1, "filename": "mffpy-0.3.0.tar.gz", "has_sig": false, "md5_digest": "c229d2715313509a4c9a354ea03c8fb9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 108633, "upload_time": "2019-09-25T23:26:37", "url": "https://files.pythonhosted.org/packages/b4/b8/85aa06bd629af7035920fd4ceddf08d60b894e216739ee8a5a62acb3a1ee/mffpy-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "76ae8820078f837e86ed7e3e739b42b2", "sha256": "cec000d6d161a882730a451c2749871014af5a0f7b692080ee69b6e878681d8f" }, "downloads": -1, "filename": "mffpy-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "76ae8820078f837e86ed7e3e739b42b2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 131974, "upload_time": "2019-09-25T23:26:34", "url": "https://files.pythonhosted.org/packages/c0/f5/7b0bbf4ae4ef27adde2f39b8cdab928d1b8049d98769fb76200ce5ad5887/mffpy-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c229d2715313509a4c9a354ea03c8fb9", "sha256": "2c6aaa47e3da453237efceb9561f3ab9386fd2039e2c84afac84a5f1763bae2a" }, "downloads": -1, "filename": "mffpy-0.3.0.tar.gz", "has_sig": false, "md5_digest": "c229d2715313509a4c9a354ea03c8fb9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 108633, "upload_time": "2019-09-25T23:26:37", "url": "https://files.pythonhosted.org/packages/b4/b8/85aa06bd629af7035920fd4ceddf08d60b894e216739ee8a5a62acb3a1ee/mffpy-0.3.0.tar.gz" } ] }