-
Notifications
You must be signed in to change notification settings - Fork 134
RegionTimeSeriesImporter cannot remember sample rate of TimeSeries EEG MAT data #765
Copy link
Copy link
Open
Description
Describe the bug
When uploading EEG MAT data to a project, the sampling rate specified in "sampling rate (Hz)" field cannot be remembered, and fallbacks to 1.0s.
Steps to reproduce
- In project data structure viewer, open an upload window, and select "TimeSeries EEG MAT" tab
- Select a MAT-formatted data file, and set "sampling rate (Hz)" to 500
- Input other information
- Upload
- In project data structure viewer, click on the uploaded file
- The "DataTypeDetails" window says the Sample Period is 1.0 (s)
Expected results
The "DataTypeDetails" window should say the Sample Period is 0.002 (s)
Actual results
The "DataTypeDetails" window says the Sample Period is 1.0 (s)
Additional information
After checking the source code, I found the launch() function, defined in RegionTimeSeriesImporter class, did not register the sampling_rate property of view_model to the ts object. While the start_time property is registered.
I modified the launch() function, added 1 new line like the following code:
ts.start_time = view_model.start_time
ts.sample_period_unit = 's'
# Added by Picsell Dois
# Fix a problem which prevents the uploader from remembering sampling rate
ts.sample_period = 1.0 / view_model.sampling_rate
# EndOf: Added by Picsell Dois
After relaunching TVB, the sample rate can be remembered properly:

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels