If you only want to run goofi-pipe and not edit any of the code, make sure you activated the desired Python environment with Python>=3.8 and run the following commands in your terminal:
pip install git+https://github.com/PhilippThoelke/goofi-pipe # install goofi-pipe
goofi-pipe # start the application
In your terminal, make sure you activated the desired Python environment with Python>=3.8, and that you are in the directory where you want to install goofi-pipe. Then, run the following commands:
git clone git@github.com:PhilippThoelke/goofi-pipe.git # download the repository
cd goofi-pipe # navigate into the repository
pip install -e . # install goofi-pipe in development mode
goofi-pipe # start the application to make sure the installation was successful
To access the node menu, simply double-click anywhere within the application window or press the 'Tab' key. The node menu allows you to add various functionalities to your pipeline. Nodes are categorized for easy access, but if you're looking for something specific, the search bar at the top is a handy tool.
Common Parameters: All nodes within goofi have a set of common parameters. These settings consistently dictate how the node operates within the pipeline.
AutoTrigger: This option, when enabled, allows the node to be triggered automatically. When disabled, the node is triggered when it receives input.
Max_Frequency: This denotes the maximum rate at which computations are set for the node.
Metadata: This section conveys essential information passed between nodes. Each output node will be accompanied by its metadata, providing clarity and consistency throughout the workflow.
Here are some conventional components present in the metadata
Channel Dictionary: A conventional representation of EEG channels names.
Sampling Frequency: The rate at which data samples are measured. It's crucial for maintaining consistent data input and output across various nodes.
Shape of the Output: Details the format and structure of the node's output.
This image showcases the process of utilizing a pre-recorded EEG signal through the LslStream
node. It's crucial to ensure that the Stream Name
in the LslStream
node matches the stream name in the node receiving the data. This ensures data integrity and accurate signal processing in real-time.
This patch provides a demonstration of basic EEG signal processing using goofi-pipe.
EegRecording: This is the starting point where the EEG data originates.
LslClient: The LslClient
node retrieves the EEG data from EegRecording
. Here, the visual representation of the EEG data being streamed in real-time is depicted. By default, the multiple lines in the plot correspond to the different EEG channels.
Buffer: This node holds the buffered EEG data.
Psd: Power Spectral Density (PSD) is a technique to measure a signal's power content versus frequency. In this node, the raw EEG data is transformed to exhibit its power distribution across distinct frequency bands.
Math: This node is employed to execute mathematical operations on the data. In this context, it's rescaling the values to ensure a harmonious dynamic range between 0 and 1, which is ideal for image representation. The resultant data is then visualized as an image.
One of the user-friendly features of goofi-pipe is the capability to toggle between different visualizations. By 'Ctrl+clicking' on any plot within a node, you can effortlessly switch between a line plot and an image representation, offering flexibility in data analysis.
Expanding on the basic patch, the advanced additions include:
These nodes elevate data processing and communication capabilities.
This patch highlights:
Connectivity: Analyzes relationships between EEG channels, offering selectable methods like wPLI
, coherence
, PLI
, and more.
Spectrogram: Created using the PSD
node followed by a Buffer
, it provides a time-resolved view of the EEG signal's frequency content.
Using PCA (Principal Component Analysis) allows us to reduce the dimensionality of raw EEG data, while retaining most of the variance. We use the first three components and visualize their trajectory, allowing us to identify patterns in the data over time. The topographical maps show the contrbution of each channel to the first four principal components (PCs).
leverage the multimodal framework of goofi, state-of-the-art machine learning classifiers can be built on-the-fly to predict behavior from an array of different sources. Here's a brief walkthrough of three distinct examples:
This patch captures raw EEG signals using the
EEGrecording
and LslStream
module. The classifier module allows
to capture data from different states indicated by the user from n features, which in the present case are the 64 EEG channels. Some classifiers allow for visualization of feature importance. Here we show a topomap of the distribution of features importances on the scalp. The classifier outputs probability of being in each of the states in the training data. This prediction is smoothed using a buffer for less jiterry results.
The audio input stream captures real-time sound data, which can also be passed through a classifier. Different sonic states can be predicted in realtime.
In this example, video frames are extracted using the
VideoStream
module. Similarly, prediction of labelled visual states can be achieved in realtime.
The images show how two states (being on the left or the right side of the image) can be detected using classification
These patches demonstrate the versatility of our framework in handling various types of real-time data streams for classification tasks.
This patch presents a pipeline for processing EEG data to extract musical features:
Data flows from the EEG recording through several preprocessing nodes and culminates in the Biotuner node, which specializes in deriving musical attributes from the EEG.
Biotuner Node: With its sophisticated algorithms, Biotuner pinpoints harmonic relationships, tension, peaks, and more, essential for music theory analysis.
Delving into the parameters of the Biotuner node:
N Peaks
: The number of spectral peaks to consider.F Min
& F Max
: Defines the frequency range for analysis.Precision
: Sets the precision in Hz for peak extraction.Peaks Function
: Method to compute the peaks, like EMD, fixed band, or harmonic recurrence.N Harm Subharm
& N Harm Extended
: Configures number of harmonics used in different computations.Delta Lim
: Defines the maximal distance between two subharmonics to include in subharmonic tension computation.For a deeper understanding and advanced configurations, consult the Biotuner repository.
To simplify understanding, we've associated specific shapes with data types at the inputs and outputs of nodes:
The nodes used in goofi-pipe can be categorized as follows:
Inputs:
AudioStream
LslClient
SerialStream
VideoStream
Array:
Join
Math
Reduce
Select
Transpose
Signal:
Buffer
Smooth
Resample
Filter
Psd
Hilbert
WelfordZTransform
StatisBaseline
Analysis:
Biosignal Analysis:
Powerbands
LempelZiv
Connectivity
CardiacRespiration
Music Theory Analysis:
Biotuner
Biorhythms
Spectromorphology
Transitional Harmony
Outputs:
OscoOut
WriteCsv
AudioOut
SharedMemOut
Misc: