-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preprocessing #10
base: master
Are you sure you want to change the base?
Preprocessing #10
Conversation
Pre-processing/PlotAllChannels.py
Outdated
|
||
|
||
#Load Data | ||
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/00003010_s003_t000.edf' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local path needs to change, won't work on another computer.
Pre-processing/PlotOneChannel.py
Outdated
|
||
|
||
#Load Data | ||
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/00003010_s003_t000.edf' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, need to point to file not an absolute path.
Pre-processing/PlotOneChannel.py
Outdated
raw = read_raw_edf(load_path, preload=True) | ||
|
||
#Inspect the .edf file | ||
print(raw.info['ch_names']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to inspect the file when running? Or are these just for debugging? If the latter, I think we can remove all inspection print statements.
}, | ||
"scripts": { | ||
"build:css": "postcss src/styles/tailwind.css -o src/styles/app.css", | ||
"watch:css": "postcss src/styles/tailwind.css -o src/styles/app.css --watch", | ||
"react-scripts:start": "sleep 5 && react-scripts start", | ||
"react-scripts:start": "timeout 5 && react-scripts start", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windows specific changes should be handled dynamically and not hardcoded. We should think about this carefully before merging to master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed.
@@ -146,7 +146,7 @@ | |||
"resolved" "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz" | |||
"version" "7.13.13" | |||
dependencies: | |||
"@babel/compat-data" "^7.13.12" | |||
"@babel/compat-data" "^7.13.15" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with these changes. We should probably have an OS-specific switch that determines the correct versions here.
2 plots for each Channel: one for RAW Data and other is Spectral Power Density PlotAllChannels plots and saves the images as well
Pre-processing/PlotAllChannels.py
Outdated
|
||
|
||
#Load Data | ||
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/00003010_s003_t000.edf' | ||
filename = '00003010_s003_t000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's fine for now, but when I integrate with front end I want to pull this filename from the api call instead of hardcoded
Pre-processing/PlotAllChannels.py
Outdated
|
||
|
||
#Load Data | ||
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/00003010_s003_t000.edf' | ||
filename = '00003010_s003_t000' | ||
fileformat = '.edf' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk if this would be necessary if filename passed through api call
Pre-processing/PlotAllChannels.py
Outdated
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/00003010_s003_t000.edf' | ||
filename = '00003010_s003_t000' | ||
fileformat = '.edf' | ||
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/' + filename + fileformat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general relative paths are preferred, but passing in filename should make this a non-issue. When web-hosting this will be a more interesting problem. We should try to have pre-processing code run on the front end
Pre-processing/PlotAllChannels.py
Outdated
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/00003010_s003_t000.edf' | ||
filename = '00003010_s003_t000' | ||
fileformat = '.edf' | ||
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/' + filename + fileformat | ||
print(load_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove debugging code when we integrate w master
Pre-processing/PlotAllChannels.py
Outdated
print(load_path) | ||
raw = read_raw_edf(load_path, preload=True) | ||
|
||
#Inspect the .edf file | ||
print(raw.info) | ||
|
||
#Make a directory | ||
directory = filename + '_allChannels' | ||
parent_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/GeneratedPlots/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! once again relative paths, maybe something like os.pwd()
Pre-processing/PlotAllChannels.py
Outdated
#Plotting begins! | ||
#Raw data | ||
raw.plot(duration=100, block=True) | ||
plt.show() | ||
#todo: instead of scrolly image, get a static image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we get this running on the front end, we might not even need to save anything! Tricky problem though since browser only runs js/css/html
Pre-processing/PlotOneChannel.py
Outdated
|
||
|
||
#Load Data | ||
load_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/TUH/00003010_s003_t000.edf' | ||
filename = '00003010_s003_t000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same note as above, relative paths + filename either passed in, or raw data is
Pre-processing/PlotOneChannel.py
Outdated
|
||
#Make a directory | ||
directory = filename | ||
parent_path = 'C:/Users/User/Desktop/CSE 481C - Neruo Capstone/Project Repo/Data/GeneratedPlots/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relative path
Plots RAW data of all channels in an interactive GUI
Pre-processing/epochs.py
Outdated
@@ -0,0 +1,69 @@ | |||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is largely taken from: https://mne.tools/mne-realtime/_modules/mne/epochs.html.
Please make sure to cite any code you copy-paste.
@@ -0,0 +1,4 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these .idea files are not necessary. They help render the project in your local IDE. Please remove any .idea/ files. We should add this to .gitignore to avoid in future pushes.
Pre-processing/epochs.py
Outdated
@@ -0,0 +1,69 @@ | |||
import os | |||
import mne | |||
import numpy as np |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this code seems to already exists in the MNE package. Why are we writing it locally instead of calling it from the package?
RAW of all channels TFR of all channels SPD of all channels
also changed the relative path of parent_path
No description provided.