{"id":45150875,"url":"https://github.com/zywkloo/edfviewer-macos","last_synced_at":"2026-02-20T03:00:59.182Z","repository":{"id":339249138,"uuid":"1161096205","full_name":"zywkloo/EDFViewer-MacOS","owner":"zywkloo","description":"EDFBrowser-MacOS","archived":false,"fork":false,"pushed_at":"2026-02-18T18:39:53.000Z","size":28,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-18T22:36:40.592Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zywkloo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-18T18:20:36.000Z","updated_at":"2026-02-18T18:22:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zywkloo/EDFViewer-MacOS","commit_stats":null,"previous_names":["zywkloo/edfviewer-macos"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zywkloo/EDFViewer-MacOS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zywkloo%2FEDFViewer-MacOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zywkloo%2FEDFViewer-MacOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zywkloo%2FEDFViewer-MacOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zywkloo%2FEDFViewer-MacOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zywkloo","download_url":"https://codeload.github.com/zywkloo/EDFViewer-MacOS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zywkloo%2FEDFViewer-MacOS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29639808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"online","status_checked_at":"2026-02-20T02:00:07.535Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-20T03:00:58.575Z","updated_at":"2026-02-20T03:00:59.168Z","avatar_url":"https://github.com/zywkloo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# EDFViewer-MacOS\n\nA native macOS SwiftUI viewer for EDF/BDF biomedical signal files — free, open source, and built for clinicians, researchers, and patients.\n\n\u003e Licensed under the [MIT License](LICENSE). Free to use, modify, and distribute.\n\n---\n\n## Why This Exists\n\n[EDFbrowser](https://www.teuniz.net/edfbrowser/) is a widely used open source EDF viewer but requires Qt and does not feel native on macOS. This project brings EDF/BDF viewing to macOS as a first-class native app — no Java, no Wine, no Qt. Just Swift and SwiftUI.\n\n---\n\n## Features\n\n- Native macOS app built with SwiftUI (macOS 13+)\n- Opens real EDF and BDF files with a pure Swift parser\n- Channel sidebar for selection and navigation\n- Waveform rendering using min/max downsampling for smooth zoomed-out views\n- Reader abstraction that allows swapping parsers without touching the UI\n- Test suite covering parsing, signal processing, and end-to-end waveform reading\n\n---\n\n## Architecture\n\nThe project follows a layered architecture with a clean protocol boundary between the parser and the UI.\n\n```\n┌─────────────────────────────────────────┐\n│                  UI Layer               │\n│  ContentView · ViewerViewModel          │\n│  WaveformMinMaxView · SettingsView      │\n└────────────────┬────────────────────────┘\n                 │ EDFReading protocol\n┌────────────────▼────────────────────────┐\n│               Core Layer                │\n│                                         │\n│  EDFReading (protocol)                  │\n│  ├── MockEDFReader   synthetic data     │\n│  ├── RealEDFReader   pure Swift parser  │\n│  └── EDFlibReader    (planned, C-based) │\n│                                         │\n│  SignalProcessing    min/max downsample │\n│  Models              ChannelInfo        │\n│                      WaveformWindow     │\n│                      DownsampledWaveform│\n└─────────────────────────────────────────┘\n```\n\n### Key Design Decisions\n\n**Protocol-driven reader (`EDFReading`)** — The UI never knows which parser is active. Any conforming reader can be swapped in at the factory level without touching a single view.\n\n**Pure Swift parser (`RealEDFReader`)** — Parses EDF/BDF headers and data records natively. No C dependencies, no bridging headers. Supports both EDF (2-byte samples) and BDF (3-byte samples) with correct digital-to-physical calibration.\n\n**Min/max downsampling (`SignalProcessing`)** — Renders millions of samples at any zoom level by computing per-bucket min and max values. This preserves signal peaks that naive decimation would miss.\n\n**XCGen (`project.yml`)** — The Xcode project is generated from `project.yml` using [XcodeGen](https://github.com/yonaskolb/XcodeGen). Do not edit the `.xcodeproj` directly.\n\n### Source Layout\n\n```\nSources/EDFViewerMac/\n├── App/\n│   └── EDFViewerMacApp.swift      app entry point and scene setup\n├── Core/\n│   ├── Models.swift               ChannelInfo, WaveformWindow, DownsampledWaveform\n│   ├── EDFReader.swift            EDFReading protocol + MockEDFReader\n│   ├── RealEDFReader.swift        pure Swift EDF/BDF parser\n│   └── SignalProcessing.swift     min/max downsampling\n└── UI/\n    ├── ContentView.swift          root layout with sidebar\n    ├── ViewerViewModel.swift      state management and reader coordination\n    ├── WaveformMinMaxView.swift   Canvas-based waveform renderer\n    └── SettingsView.swift         user preferences\nTests/EDFViewerMacTests/\n├── EDFReaderTests.swift           unit tests for Mock and Real readers\n├── EDFReadIntegrationTests.swift  end-to-end parse and downsample tests\n├── SignalProcessingTests.swift    downsampling correctness\n└── ViewerViewModelTests.swift     ViewModel state tests\n```\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- macOS 13 or later\n- Xcode 15 or later\n- [XcodeGen](https://github.com/yonaskolb/XcodeGen) — generates the `.xcodeproj` from `project.yml`\n\n\u003e **Note:** `.xcodeproj` is not committed to the repo. You must generate it locally before opening in Xcode.\n\n---\n\n### Setup\n\n**1. Install XcodeGen**\n\n```bash\nbrew install xcodegen\n```\n\n**2. Clone the repo**\n\n```bash\ngit clone https://github.com/your-org/EDFViewer-MacOS.git\ncd EDFViewer-MacOS\n```\n\n**3. Generate the Xcode project**\n\n```bash\nxcodegen generate\n```\n\nThis reads `project.yml` and produces `EDFViewerMac.xcodeproj`. Re-run this any time `project.yml` changes (e.g. after pulling new files or adding targets).\n\n**4. Open in Xcode and run**\n\n```bash\nopen EDFViewerMac.xcodeproj\n```\n\nPress `Cmd+R` to build and run.\n\n**5. Try the sample file**\n\nA sample EDF file is included in `Samples/combined-sample.edf`. Use **File → Open** in the app to load it and verify everything is working.\n\n---\n\n### Run Tests\n\n```bash\nxcodebuild test -project EDFViewerMac.xcodeproj -scheme EDFViewerMac\n```\n\n---\n\n## Roadmap\n\n### Done — Viewer Foundation\n- [x] Native SwiftUI macOS app\n- [x] Pure Swift EDF/BDF parser with digital-to-physical calibration\n- [x] Channel sidebar and waveform rendering\n- [x] All Channels stacked montage view\n- [x] Min/max downsampling for performant rendering\n- [x] Pan with boundary clamping (arrows disable at file edges)\n- [x] Time-axis grid overlay\n- [x] Unit and integration test suite\n\n### Next — Usable Viewer (Milestone 1)\n- [ ] Per-channel amplitude scaling\n- [ ] Keyboard navigation (arrow keys, scroll wheel zoom)\n- [ ] Large-file IO redesign (mmap + LRU cache)\n- [ ] Header inspector panel\n\n### Then — Annotations + Measurement (Milestones 2–3)\n- [ ] EDF+ annotation channel parsing (TAL)\n- [ ] Annotation overlay, list panel, and editor\n- [ ] Crosshair cursor with time + amplitude readout\n- [ ] Rectangle zoom\n\n### Later — Processing + Clinical (Milestones 4–6)\n- [ ] Notch + bandpass filters\n- [ ] FFT / power spectrum view\n- [ ] Montage editor with 10-20 EEG presets\n- [ ] Pan-Tompkins QRS detector\n\nSee [ROADMAP.md](ROADMAP.md) for the full milestone plan and EDFbrowser feature comparison.\n\n---\n\n## Contributing\n\nPull requests are welcome. Please open an issue first for significant changes.\n\nThe `EDFReading` protocol is the right place to add new parser backends — conform to it and update `EDFReaderFactory`. The UI does not need to change.\n\n---\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n\n`edflib.c` and `edflib.h` by Teunis van Beelen are licensed under BSD 3-clause and retain their original copyright headers.\n\n---\n\n*\"Whatever you do, work at it with all your heart, as working for the Lord, not for human masters.\"*\n— Colossians 3:23\n\n*\"Heal the sick, cleanse the lepers, raise the dead, cast out devils: freely ye have received, freely give.\"*\n— Matthew 10:8\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzywkloo%2Fedfviewer-macos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzywkloo%2Fedfviewer-macos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzywkloo%2Fedfviewer-macos/lists"}