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.7.tar.gz (20.7 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.7-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: neuropipeline-0.1.7.tar.gz
  • Upload date:
  • Size: 20.7 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.7.tar.gz
Algorithm Hash digest
SHA256 09af4b13e8f13a166d592ff430ca1e50ce930bbe6738e8719fc84598259ceed7
MD5 dc55dd2b8c15e91f5c887243fe772eaa
BLAKE2b-256 44efac8bf8a1864d1bc4e5ff9112c2fe5efed6043755cfd62c6698f678f5eb2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: neuropipeline-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 18.7 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f6b95f8fea10572de9cf0f395fd751c815b8157a9360eb1afcfabdfdaba5436a
MD5 629657cce9570504d300ea0f22525285
BLAKE2b-256 4c2feded44f3cb0f6f3b592a4a71f6304b5fe1693bdc467e47ddbb3479c82bdb

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