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 | 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neuropipeline-0.1.9.tar.gz.
File metadata
- Download URL: neuropipeline-0.1.9.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af632160027994cd39f8f861d53de1a8c2d2514a493fbbd491fc48a2536063d8
|
|
| MD5 |
c6df47a4b80c761c23a7051dc2871abb
|
|
| BLAKE2b-256 |
eed93a6194c4ab2d0804c7ee88cec34858518f65e17854dc2bf5d2757d9b1777
|
File details
Details for the file neuropipeline-0.1.9-py3-none-any.whl.
File metadata
- Download URL: neuropipeline-0.1.9-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81c61fed1f1bb4e2a01aedb1b033a8ed8a258f5736cdd52b51c636a4b13e0488
|
|
| MD5 |
a6dbe2f441226d63370578f9b0ea1397
|
|
| BLAKE2b-256 |
22396cc771a58b3f4a8c8574dee7f15fdb5f061a10897d3dc940f19ee42ab7de
|