Chronic BrainSense Recording Pipeline

Overview

The Chronic BrainSense Recording Pipeline is a Python module specific for handling both Chronic Brain Power and Event Power Spectrum data format from Percept. This section will go over all functions implemented and provide sufficient details on pipeline implementation.

Methods

Percept.ChronicBrainSense.saveChronicLFP(deviceID, ChronicLFPs, sourceFile)

Save Chronic BrainSense Data in Database Storage

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

  • ChronicLFPs – Chronic BrainSense (Power-band) 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.ChronicBrainSense.queryChronicLFPs(user, patientUniqueID, TherapyHistory, authority)

Query Chronic LFPs based on Therapy History.

This function will query Chronic BrainSense Power Band data and Event PSDs based on therapy change logs. This design is made because a change in therapy group may lead to different therapy effect or BrainSense configurations.

Parameters
  • user – BRAVO Platform User object.

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

  • TherapyHistory – List of therapy change logs ordered by time extracted from Therapy.queryTherapyHistory.

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

Returns

Returns a list of LFPTrends, where each LFPTrends are continuous BrainSense Power with the same therapy configurations.

Percept.ChronicBrainSense.processChronicLFPs(LFPTrends, timezoneOffset=0, normalizeCircadian=False)

Process Chronic LFPs based on Therapy History.

This pipeline will take the Chronic BrainSense data extracted from queryChronicLFPs and further processed to calculate Event-Locked Power, Therapy Amplitudes, and Circadian Rhythms.

Event-Locked Power:

Take all BrainSense power within the same therapy configurations and calculate power trend 3 hours before and after an event marking to identify changes in brain power related to pathology or events.

Therapy Amplitudes:

When BrainSense is enabled, the therapy amplitude is logged. User can simply correlate brain power at different therapy amplitude to track pathological brain signals with adjustable therapy amplitude.

Circadian Rhythms:

Brain signal changes with sleep, and circadian rhythm analysis takes the timezoneOffset that the patient has and overlay all Chronic BrainSense on a 24-hour scale in a 30 minutes window.

Parameters
  • LFPTrends – List of Chronic BrainSense Power data extracted from queryChronicLFPs.

  • timezoneOffset – user timezone offset from UTC, used to perform 24-hours circadian rhythm analysis.

Returns

Returns a list of LFPTrends, where each LFPTrends are continuous BrainSense Power with the same therapy configurations.