Replies: 3 comments 2 replies
-
So weird this happened again. And again when I run this I have no problems, spindles are detected. I ran the following code on Windows with import numpy as np
import yasa
sf = 200
data = np.loadtxt('./data_N2_spindles_15sec_200Hz.txt')
sp = yasa.spindles_detect(data, sf) @meniua are you using the same versions? If not could you try that? |
Beta Was this translation helpful? Give feedback.
-
Same issue here. This is my pip list Package Version alabaster 0.7.12 |
Beta Was this translation helpful? Give feedback.
-
Opened an issue here: #107 Let's move the conversation there |
Beta Was this translation helpful? Give feedback.
-
When trying to use YASA to perform single-channel sleep spindles detection(with the sample data of yasa), after'sp = yasa.spindles_detect(data, sf)', it return nonetype:
E:\Software\Anaconda\python.exe E:\python_work\SpindlerDetection\yuan.py
[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.
[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 0.0s remaining: 0.0s
[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 0.0s finished
[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.
[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 0.0s remaining: 0.0s
[Parallel(n_jobs=1)]: Done 1 out of 1 | elapsed: 0.0s finished
<class 'NoneType'>
23-Nov-22 19:43:26 | WARNING | No spindle were found in channel CHAN000.
23-Nov-22 19:43:26 | WARNING | No spindles were found in data. Returning None.
Traceback (most recent call last):
File "E:\python_work\SpindlerDetection\yuan.py", line 32, in
mask = sp.get_mask()
AttributeError: 'NoneType' object has no attribute 'get_mask'
import yasa
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(font_scale=1.2)
data = np.loadtxt('E:/yasa-master/notebooks/data_N2_spindles_15sec_200Hz.txt')
sf = 200
times = np.arange(data.size) / sf
sp = yasa.spindles_detect(data, sf)
print(type(sp))
mask = sp.get_mask()
spindles_highlight = data * mask
spindles_highlight[spindles_highlight == 0] = np.nan
fig, ax = plt.subplots(1, 1, figsize=(14, 4))
plt.plot(times, data, lw=1.5, color='tab:grey')
plt.plot(times, spindles_highlight, lw=1.5, color='tab:blue')
plt.xlabel('Time (seconds)')
plt.ylabel('Amplitude (uV)')
plt.xlim([0, times[-1]])
plt.xticks(np.arange(0, 19, 2))
plt.title('Spindles detection')
sns.despine()
Beta Was this translation helpful? Give feedback.
All reactions