From dee23eb06a6d57657ddabc053e5d952ab1da18ff Mon Sep 17 00:00:00 2001 From: Vicky Bikia Date: Tue, 12 Mar 2024 10:50:05 -0700 Subject: [PATCH] Update README files --- ECGDataPipelineTemplate/README.md | 6 ++-- README.md | 57 +++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/ECGDataPipelineTemplate/README.md b/ECGDataPipelineTemplate/README.md index c426fa6f..64de9d53 100644 --- a/ECGDataPipelineTemplate/README.md +++ b/ECGDataPipelineTemplate/README.md @@ -28,9 +28,9 @@ The Spezi ECG Data Pipeline adopts a modular structure, comprising several Pytho - `visualization.py`: Contains functions for data visualization. - `SpeziECGDataIteractECGDataPipelineTemplateiveTool.ipynb`: An interactive notebook for analyzing and reviewing ECG data. -## Running the Notebook in Google Colab +## Run the Notebook in Google Colab -You can open the `ECGDataPipelineTemplate.ipynb` notebook in Google Colab by clicking the "Open In Colab" badge above. +You can open and run the `ECGDataPipelineTemplate.ipynb` notebook in Google Colab by clicking the "Open In Colab" badge above. ### Setup Instructions in Colab @@ -44,7 +44,7 @@ Once the notebook is open in Colab, execute the following cell to clone the Spez Remember to upload the `serviceAccountKey_file.json` to the Colab workspace directory to enable Firebase access. This file is necessary for authentication and should be securely handled. -### Using the Interactive ECG Reviewing Tool +### Use the Interactive ECG Reviewing Tool To start reviewing ECG data, execute the following cells in your notebook: diff --git a/README.md b/README.md index ee87e766..45253e10 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ SPDX-License-Identifier: MIT [![Beta Deployment](https://github.com/StanfordBDHG/PediatricAppleWatchStudy/actions/workflows/beta-deployment.yml/badge.svg)](https://github.com/StanfordBDHG/PediatricAppleWatchStudy/actions/workflows/beta-deployment.yml) [![codecov](https://codecov.io/gh/StanfordBDHG/PediatricAppleWatchStudy/graph/badge.svg?token=0SNRhbC0wi)](https://codecov.io/gh/StanfordBDHG/PediatricAppleWatchStudy) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10602852.svg)](https://doi.org/10.5281/zenodo.10602852) +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/[YourGitHub]/SpeziECGDataAnalysisPipeline/blob/main/SpeziECGDataInteractiveTool.ipynbhttps://colab.research.google.com/github/StanfordBDHG/PediatricAppleWatchStudy/blob/main/ECGDataPipelineTemplate/ECGDataPipelineTemplate.ipynb) This repository contains the Pediatric Apple Watch Study Application application. The Pediatric Apple Watch Study Application is using the [Spezi](https://github.com/StanfordSpezi/Spezi) ecosystem and builds on top of the [Stanford Spezi Template Application](https://github.com/StanfordSpezi/SpeziTemplateApplication). @@ -33,6 +34,62 @@ The application uses the FHIR standard to provide a shared standard to encode da You can build and run the application using [Xcode](https://developer.apple.com/xcode/) by opening up the **PAWS.xcodeproj**. +## ECG Data Pipeline + +### Pipeline Structure + +The Spezi ECG Data Pipeline adopts a modular structure, comprising several Python modules and a notebook for interactive data visualization and analysis: + +- `firebase_access.py`: Manages access to Firebase for data storage and retrieval. +- `data_preparation.py`: Prepares and processes raw ECG data. +- `utils.py`: Provides utility functions for data processing. +- `visualization.py`: Contains functions for data visualization. +- `SpeziECGDataIteractECGDataPipelineTemplateiveTool.ipynb`: An interactive notebook for analyzing and reviewing ECG data. + +### Run the Notebook in Google Colab + +You can open and run the `ECGDataPipelineTemplate.ipynb` notebook in Google Colab by clicking the "Open In Colab" badge above. + +### Setup Instructions in Colab + +Once the notebook is open in Colab, execute the following cell to clone the Spezi ECG Data Analysis Pipeline repository and navigate into the cloned directory: + +```python +# Cell 1: Clone GitHub repository for Spezi ECG Data Pipeline +!git clone https://github.com/StanfordBDHG/PediatricAppleWatchStudy.git +%cd PediatricAppleWatchStudy/ECGDataPipeline +``` + +Remember to upload the `serviceAccountKey_file.json` to the Colab workspace directory to enable Firebase access. This file is necessary for authentication and should be securely handled. + +### Use the Interactive ECG Reviewing Tool + +To start reviewing ECG data, execute the following cells in your notebook: + +```python +# Cell 2: Import modules +from Modules.firebase_access import * +from Modules.data_preparation import * +from Modules.visualization import * +from Modules.utils import * +import os + +# Cell 3: Define the path to your service account key file +serviceAccountKey_file = 'path/to/serviceAccountKey.json' + +# Cell 4: Connect to Firebase and download data +db = connect_to_firebase(serviceAccountKey_file) +ecg_data = process_data(db) + +# Cell 5: Initialize the ECG Data Viewer and start reviewing +viewer = ECGDataViewer(ecg_data, db) +``` + +This interactive tool allows you to plot ECG data, add diagnoses, evaluate the trace quality, and add notes. + +![ecg_data_interactive_tool_snapshot.png](Figures/ecg_data_interactive_tool_snapshot.png) + + ## Contributing Contributions to this project are welcome. Please make sure to read the [contribution guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) and the [contributor covenant code of conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) first.