Skip to content

Commit

Permalink
Merge branch 'master' of github.com:NEUROFUSIONInc/fusion into feat/i…
Browse files Browse the repository at this point in the history
…mplement-application-insights
  • Loading branch information
TemitopeAsama committed Aug 1, 2024
2 parents edc4398 + fda3586 commit d239f4d
Show file tree
Hide file tree
Showing 129 changed files with 27,746 additions and 18,314 deletions.
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run Fusion Copilot (iOS)",
"skipFiles": ["<node_internals>/**"],
"cwd": "${workspaceFolder}/mobile",
"runtimeExecutable": "npx",
"runtimeArgs": ["expo", "run:ios"]
},
{
"type": "python",
"request": "launch",
"name": "Run Analysis API",
"program": "${workspaceFolder}/analysis_api/app.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/analysis_api"
}
]
}
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,34 @@ We build tools to accelerate the adoption of neurotechnology and behavior resear
## Roadmap

- [x] Record EEG while performing various activities using [Neurosity Crown](https://neurosity.co) and [Muse](https://choosemuse.com)
Supported activities:

Supported activities on https://usefusion.ai/playground:

- [x] Open Ended Brain Recording
- [x] Resting state (Eyes Closed/Eyes Open)
- [x] Stroop Task
- [x] Auditory Oddball
- [x] Flappy Bird game (Detecting intent & frustration)

- [ ] Analysis of collect data
- [ ] Analysis of collected data https://usefusion.ai/analysis

- [ ] Chart of steady state frequency power across recordings
- [x] Chart of steady state frequency power across recordings
- [ ] Periodic vs. aperiodic frequency evaluation using [fooof package](https://fooof-tools.github.io/fooof/)
- [ ] If applicable event related potential analysis
- [ ] Periodic vs. aperiodic frequecny evaluation using [fooof package](https://fooof-tools.github.io/fooof/)

- [ ] Connect your screentime events & productivity metrics using [ActivityWatch](https://activitywatch.net)
- [ ] Connect screentime events & productivity metrics from [Magicflow](https://magicflow.com)
- [ ] Running Distributed Studies with people (Quests) https://usefusion.ai/blog/quests

- [x] A set of prompts people respond to at intervals on a topic related to you
- [x] Connecting Apple Health - steps, sleep, heart-rate
- [ ] Support for cognitive experiments
- [ ] Quest Dashboard - view submissions, analyze and publish results

- [ ] Deploy quests to people devices - a quest is a protocol person is to follow for data collection.
- [ ] It can involve prompts, recording, brain activity
- [ ] Query your data with natural language
- [ ] Design and upload custom EEG experiment protocols to participants' devices

- [ ] Connecting Other Sources
- [ ] Connect your screentime events & productivity metrics using [ActivityWatch](https://activitywatch.net)
- [ ] Connect screentime events & productivity metrics from [Magicflow](https://magicflow.com)

## Tech Stack

- [Frontend](https://github.com/NEUROFUSIONInc/fusion/tree/master/frontend): React, Next.js
Expand All @@ -40,7 +46,7 @@ We build tools to accelerate the adoption of neurotechnology and behavior resear

## How to contribute

See the [issues](https://github.com/NEUROFUSIONInc/fusion/issues) for features we're actively developing.
We welcome all contributions! See the [issues](https://github.com/NEUROFUSIONInc/fusion/issues) for features we're actively developing.

- [Join the Fusion Community](https://discord.gg/3wCNJ6X4RF)

Expand Down
36 changes: 36 additions & 0 deletions analysis_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,42 @@ def process_eeg():

# TODO: endpoint for ERP analysis

@app.route('/api/v1/process_eeg_fooof', methods=['POST'])
def process_eeg_fooof():
try:
# Check if the POST request contains a file with the key 'file'
if 'file' not in request.files:
return jsonify({'error': 'No file part'}), 400

if 'fileTimestamp' not in request.form:
return jsonify({'error': 'No file timestamp'}), 400

file = request.files['file']

fileTimestamp = request.form['fileTimestamp']

# Check if the file has a filename
if file.filename == '':
return jsonify({'error': 'No selected file'}), 400

# Check if the file is a ZIP file
if file.filename.endswith('.zip'):
# Create a temporary directory to store the unzipped files
temp_dir = 'temp_unzip' # +`` "_" + str(int(time.time()))
os.makedirs(temp_dir, exist_ok=True)

# Save the ZIP file to the temporary directory
zip_file_path = os.path.join(temp_dir, file.filename)
file.save(zip_file_path)

# Unzip the file
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
zip_ref.extractall(temp_dir + "/raw_files")

print("file directory", temp_dir)
except Exception as e:
print("error", e)
return jsonify({'error': str(e)}), 500

# Endpoint for CoCoA-PAD analysis
@app.route('/api/v1/verbal_fluency', methods=['POST'])
Expand Down
2 changes: 1 addition & 1 deletion frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ NEXT_PUBLIC_NEUROFUSION_BACKEND_URL=
NEXT_PUBLIC_FUSION_NOSTR_PUBLIC_KEY=
NEXT_PUBLIC_ANALYSIS_SERVER_URL=
NEXTAUTH_URL=
NEXT_PUBLIC_APP_INSIGHTS_KEY=
NEXT_PUBLIC_APP_INSIGHTS_KEY=
2 changes: 2 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module.exports = defineConfig({
rules: {
"react/react-in-jsx-scope": "off",
"unused-imports/no-unused-imports": "error",
"@next/next/no-document-import-in-page": "off",

"import/order": [
1,
{
Expand Down
10 changes: 5 additions & 5 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
module.exports = {
reactStrictMode: true,
env: {
"NEXT_PUBLIC_FUSION_NOSTR_PUBLIC_KEY": "5f3a52d8027cdde03a41857e98224dafd69495204d93071199aa86921aa02674",
"NEXT_PUBLIC_FUSION_RELAY_URL": "wss://relay.usefusion.ai",
// "NEXT_PUBLIC_NEUROFUSION_BACKEND_URL": "https://neurofusionbackendprd.azurewebsites.net"
}
}
NEXT_PUBLIC_FUSION_NOSTR_PUBLIC_KEY: "5f3a52d8027cdde03a41857e98224dafd69495204d93071199aa86921aa02674",
NEXT_PUBLIC_FUSION_RELAY_URL: "wss://relay.usefusion.ai",
NEXT_PUBLIC_NEUROFUSION_BACKEND_URL: "https://neurofusionbackendprd.azurewebsites.net",
},
};
Loading

0 comments on commit d239f4d

Please sign in to comment.