BrainSense Survey Pipeline

Overview

The BrainSense Survey Pipeline is a Python module specific for handling BrainSense Survey data format from Percept. This section will go over all functions implemented and provide sufficient details on pipeline implementation.

Methods

Percept.BrainSenseSurvey.saveBrainSenseSurvey(deviceID, streamList, sourceFile)

Save BrainSense Survey Data in Database Storage

Parameters
  • deviceID – UUID4 deidentified id for each unique Percept device.

  • surveyList – Array of BrainSense Survey structures extracted from Medtronic JSON file.

  • sourceFile – filename of the raw JSON file that the original data extracted from.

Returns

Boolean indicating if new data is found (to be saved).

Percept.BrainSenseSurvey.querySurveyResults(user, patientUniqueID, options, requestRaw, authority)

Extract all BrainSense Survey recordings and process for power spectrum.

This pipeline will process all BrainSense Survey recordings recorded from one patient and output the average power spectrum.

Parameters
  • user – BRAVO Platform User object.

  • patientUniqueID – Deidentified patient ID as referenced in SQL Database.

  • options – BrainSenseSurvey Configuration dictionary

  • authority – User permission structure indicating the type of access the user has.

Returns

List of processed BrainSense Surveys without raw time-domain data.

Percept.BrainSenseSurvey.processBrainSenseSurvey(survey, method='spectrogram')

Calculate BrainSense Survey Power Spectrum.

The pipeline will filter the raw BrainSense Survey with a zero-phase 5th-order Butterworth filter between 1-100Hz. Then power spectrum is calculated using short-time Fourier Transform with 0.5Hz frequency resolution using 1.0 second window and 500ms overlap. Zero-padding when neccessary to increase frequency resolution.

Parameters

survey – BrainSense Survey raw object.

Returns

List of processed BrainSense Surveys without raw time-domain data.