Core Module#

Core module for loading, organizing, and analyzing EEG data.

This module provides the fundamental building blocks for the NeuRodent analysis pipeline, handling everything from raw data loading to feature extraction.

Typical Workflow:

from neurodent import visualization

# 1. Organize recordings for an animal
ao = visualization.AnimalOrganizer(
    data_path, animal_id, mode="nest",
)

# 2. Run windowed feature analysis
war = ao.compute_windowed_analysis(
    features=['psdband', 'cohere'],
    window_s=5,
    multiprocess_mode="dask",
)

# 3. Access results (WindowAnalysisResult)
df = war.result  # pandas DataFrame with all features
war.save_pickle_and_json('output/')

The lower-level classes can also be used directly:

from neurodent import core

# Load a single recording
lro = core.LongRecordingOrganizer(day_folder_path)

# Analyze in fragments
analyzer = core.LongRecordingAnalyzer(lro, fragment_len_s=5)
rms = analyzer.compute_rms(fragment_index=0)
psd = analyzer.compute_psdband(fragment_index=0)

What Gets Computed:

  • Power features: RMS, amplitude variance, band power (delta, theta, alpha, beta, gamma)

  • Connectivity: Coherence, imaginary coherence, Pearson correlation between channels

  • Spikes: Spike counts via frequency-domain detection

See Also:

Classes#

RecordingMetadata

Stores metadata information for neural recordings.

LongRecordingOrganizer

Construct a long recording from various file formats or an existing recording object.

LongRecordingAnalyzer

Class for analyzing LongRecordings by breaking them into smaller time windows (fragments).

FragmentAnalyzer

Static class for analyzing fragments of EEG data.

FrequencyDomainSpikeDetector

Static class for frequency-domain spike detection using STFT and SNEO.