Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Can't process TUH Artifact Dataset #30

Open
lienz opened this issue Aug 11, 2020 · 4 comments
Open

Can't process TUH Artifact Dataset #30

lienz opened this issue Aug 11, 2020 · 4 comments

Comments

@lienz
Copy link

lienz commented Aug 11, 2020

Hi,
I'm trying to create the TUH Artifact Dataset as follows:

dataset = TUHEEGArtifactDataset('~/Documents/eeg/tuh_artifact_eeg/edf')
dataset.set_cache_manager(PickleCache('~/Documents/eeg/export'))

preprocessing = Pipeline([
    CommonChannelSet(),
    LowestFrequency(),
    ToDataframe(),
    MinMaxCentralizedNormalization(),
    ToNumpy()
])
dataset = dataset.set_pipeline(preprocessing).load()
data, labels = dataset['data'], dataset['labels']

But it fails with the following message:
ValueError: tmin (600.9454) must be less than tmax (600.9)

I'm using the v2.0.0 of the dataset: https://www.isip.piconepress.com/projects/tuh_eeg/downloads/tuh_eeg_artifact/v2.0.0/edf/

@AlessioZanga
Copy link
Owner

The TUH Artifact has been recently updated, the adapters for the v2.0.0 are in early alpha in the feature-workspace branch

@lienz
Copy link
Author

lienz commented Aug 11, 2020

Thanks so the above code should work with v1.0.0?

@AlessioZanga
Copy link
Owner

It will work without the ToNumpy, please refer to this about the Numpy preprocessor

@ayoub1996-01
Copy link

Hi, I'm trying to run this code but it gives error

dataset = TUHEEGAbnormalDataset()
preprocessing = Pipeline([
    CommonChannelSet(),
    LowestFrequency(),
    ToDataframe(),
    MinMaxCentralizedNormalization(),
    DynamicWindow(8),
    ToNumpy()
])
dataset = dataset.set_pipeline(preprocessing).load()
data, labels = dataset['data'], dataset['labels']

output :
**2021/03/11 01:24:44 INFO: Init dataset 'Temple University Hospital EEG Abnormal Dataset'@'v2.0.0' at '/content/data/tuh_eeg_abnormal/v2.0.0'
2021/03/11 01:24:44 DEBUG: Make .pyeeglab directory
2021/03/11 01:24:44 DEBUG: Make .pyeeglab/cache directory
2021/03/11 01:24:44 DEBUG: Set MNE log .pyeeglab/mne.log
2021/03/11 01:24:44 DEBUG: Make index session
2021/03/11 01:24:44 INFO: Index data set directory
2021/03/11 01:24:44 INFO: Index data set completed
2021/03/11 01:24:44 DEBUG: Init default query
2021/03/11 01:24:44 DEBUG: SQL query representation: 'SELECT file.uuid AS file_uuid, file.path AS file_path, file.extension AS file_extension, metadata.file_uuid AS metadata_file_uuid, metadata.duration AS metadata_duration, metadata.channels_set AS metadata_channels_set, metadata.channels_reference AS metadata_channels_reference, metadata.sampling_frequency AS metadata_sampling_frequency, metadata.max_value AS metadata_max_value, metadata.min_value AS metadata_min_value, annotation.uuid AS annotation_uuid, annotation.file_uuid AS annotation_file_uuid, annotation."begin" AS annotation_begin, annotation."end" AS annotation_end, annotation.label AS annotation_label FROM file JOIN metadata ON file.uuid = metadata.file_uuid JOIN annotation ON file.uuid = annotation.file_uuid WHERE 1 = 1 AND 1 = 1 AND annotation."end" - annotation."begin" >= ?'
2021/03/11 01:24:44 DEBUG: Create new preprocessor
2021/03/11 01:24:44 DEBUG: Create common channels_set preprocessor
2021/03/11 01:24:44 DEBUG: Create new preprocessor
2021/03/11 01:24:44 DEBUG: Create lowest_frequency preprocessor
2021/03/11 01:24:44 DEBUG: Create new preprocessor
2021/03/11 01:24:44 DEBUG: Create DataFrame converter preprocessor
2021/03/11 01:24:44 DEBUG: Create new preprocessor
2021/03/11 01:24:44 DEBUG: Create new preprocessor
2021/03/11 01:24:44 DEBUG: Create dynamic frames (8) generator
2021/03/11 01:24:44 DEBUG: Create new preprocessor
2021/03/11 01:24:44 DEBUG: Create Numpy (float32) converter preprocessor
2021/03/11 01:24:44 DEBUG: Create new preprocessing pipeline


TypeError Traceback (most recent call last)

in ()
8 ToNumpy()
9 ])
---> 10 dataset2 = dataset2.set_pipeline(preprocessing).load()
11 data, labels = dataset2['data'], dataset2['labels']

2 frames

/usr/local/lib/python3.7/dist-packages/pyeeglab/dataset/dataset.py in maximal_channels_subset(self)
216 for channel in channels
217 ]
--> 218 channels = reduce(and_, channels)
219 channels = channels - frozenset(self.exclude_channels_set)
220 channels = sorted(channels)

TypeError: reduce() of empty sequence with no initial value**

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants