Closed SebastianSpeer closed 2 years ago
Hi @SebastianSpeer, is there any chance your MNE raw object isn't preloaded? We should add something in PREP itself that calls load_data()
if the data hasn't been loaded already, but I'm guessing that will solve the immediate issue.
Let me know if that works!
Thanks, that solved it!
Let me reopen this, so we don't forget to make this easier for future users :-)
Dear pyprep team,
I'm using the pyprep pipeline version 0.4.0 together with the version 0.23.4 of MNE.
I've loaded in EEG data in brainvision format and tried to apply pyprep.
Here''s the code used:
`raw = mne.io.read_raw_brainvision('/data04/Sebastian/EMP/eeg_BIDS/sub-013/eeg/sub-013_task-xxxx_eeg.vhdr', eog=('VEOG', 'HEOG','IO1','IO2','Afp9','Afp10'), misc=('M1','M2'), scale=1.0, preload=False, verbose=False)
montage = mne.channels.make_standard_montage("biosemi64") montage.plot() raw.set_montage(montage)
sample_rate = raw.info["sfreq"]
raw_copy = raw.copy()
start = time.time()
prep_params = { "ref_chs": "eeg", "reref_chs": "eeg", "line_freqs": np.arange(50, sample_rate/2, 50), }
prep = PrepPipeline(raw_copy, prep_params, montage) prep.fit()
end = time.time() print(end - start)`
And the output I receiving is found below. Is this error potentially due to the data being in Brainvision format?
Thanks for your help!
~/anaconda3/lib/python3.8/site-packages/pyprep/prep_pipeline.py in fit(self) 177 def fit(self): 178 """Run the whole PREP pipeline.""" --> 179 noisy_detector = NoisyChannels(self.raw_eeg, random_state=self.random_state) 180 noisy_detector.find_bad_by_nan_flat() 181 # unusable_channels = _union(
~/anaconda3/lib/python3.8/site-packages/pyprep/find_noisy_channels.py in init(self, raw, do_detrend, random_state, matlab_strict) 90 self.ch_names_original = ch_names 91 self.n_chans_original = len(ch_names) ---> 92 self.n_samples = raw._data.shape[1] 93 94 # Before anything else, flag bad-by-NaNs and bad-by-flats
AttributeError: 'RawBrainVision' object has no attribute '_data'