Skip to main content

A tool for quick and easy preprocessing and visualization of fNIRS data

Project description

neuropipeline

neuropipeline is a tool for quick and easy to use preprocessing and visualization of Functional Near-Infrared Spectroscopy (fNIRS) data.

Usage

from neuropipeline.fnirs import fNIRS
import neuropipeline.visualizer as nplv

fnirs = fNIRS("path/to/your_file.snirf")
fnirs.preprocess(optical_density=True,
                 hemoglobin_concentration=True,
                 motion_correction=True,
                 temporal_filtering=True,
                 detrending=True,
                 normalization=False
                 )

nplv.open(fnirs)

snirf.write_snirf("path/to/your_new_file.snirf") # WARNING: Be cautious not to overwrite any data you want to keep. 

Analysis Example: Heel Stimulation

These plots display data from a single subject during a robotic heel-stimulation experiment, showing the Time Series, Spectrogram, and Frequency (PSD/FFT) for two different scenarios. The vertical red dashed lines indicate "markers," which show exactly when a task started or when the robot moved. In this experiment, a robot stimulated the heel 6 times. In the Supination case (left), we see a clear success: oxygenated hemoglobin (HbO) increases right when the stimuli begin. This is supported by the spectrogram, where we see "spikes" of activity at 0.025 Hz (the neurogenic band) that align perfectly with the robot's movements. This confirms the pipeline has successfully captured brain activity in the sensory cortex. In contrast, the Pronation case (right) shows consistently low activity in the spectrogram, and while the time series has some small peaks, they do not show the same clear correlation with the stimulation.

Supination case Pronation case
Supination Pronation

Installation

python -m pip install neuropipeline

Advanced Usage

fnirs = fNIRS("path/to/your_file.snirf")

fnirs.preprocess(optical_density=True,
                 hemoglobin_concentration=True,
                 motion_correction=True,
                 temporal_filtering=True,
                 detrending=True,
                 normalization=False
                 )
nplv.set_spectrogram_limits(0.0, 0.12) # Hz

nplv.set_marker_dictionary({
    0: "Rest",
    1: "Stimuli A",
    2: "Stimuli B",
})

nplv.open(fnirs)

fnirs.write_snirf("path/to/your_new_file.snirf") # WARNING : Dont overwrite data you want to keep

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuropipeline-0.1.91.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuropipeline-0.1.91-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file neuropipeline-0.1.91.tar.gz.

File metadata

  • Download URL: neuropipeline-0.1.91.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for neuropipeline-0.1.91.tar.gz
Algorithm Hash digest
SHA256 3c3153f9990cc347586b52c921c25eba2e9e2d89f7aebdea0869bb42ea581a58
MD5 775a728f860325912f0bdeb52af32ec6
BLAKE2b-256 48f058134848b78c81fb004e8edf37cdb8b57adc8e75f5491238d96670a2e783

See more details on using hashes here.

File details

Details for the file neuropipeline-0.1.91-py3-none-any.whl.

File metadata

  • Download URL: neuropipeline-0.1.91-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for neuropipeline-0.1.91-py3-none-any.whl
Algorithm Hash digest
SHA256 87aaf21bc1ff2ee5e1745892f9cb4cb7ca93d3f20a08f54cc7f6059a37ffc87e
MD5 f69d468d99f5304edee80459110cab50
BLAKE2b-256 b7f04e947d1a920c2f20bde5c3d7fc67ed41863a3006f8b61a3efd2d411809aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page