Skip to content

Python package for generating BIDS-fNIRS files from SNIRF files

License

Notifications You must be signed in to change notification settings

BUNPC/snirf2bids

Repository files navigation

python pypi tests DOI

snirf2BIDS

Conveniently generate BIDS files from SNIRF files.

Installation

pip install snirf2bids

snirf2bids requires Python > 3.

Usage

SNIRF files with valid BIDS names can be converted into BIDS metadata text files.

For use with snirf2bids, a SNIRF file name must include at least the sub- and task- entitites and end in _nirs.snirf, i.e. sub-01_task-tapping_nirs.snirf.

Generate BIDS text files from a SNIRF file

If the list_files parameter is empty, snirf2bids replaces all existing BIDS files with newly generated ones; otherwise, it replaces only the files specified in list_files. The parameter retain_old_info, with a default value of True, ensures that information in the existing scans and participants files is retained whenever a conflict occurs.

snirf2bids.snirf2bids('<path to snirf file>', 'outputpath = <folder to generate files in>', 'list_files =<list of BIDS files to replace>' , 'retain_old_info=True')

Generate BIDS text files from a SNIRF file or from all SNIRF files within a directory and its subdirectories

If the list_files parameter is empty, snirf2bids replaces all existing BIDS files with newly generated ones; otherwise, it replaces only the files specified in list_files. The parameter retain_old_info, with a default value of True, ensures that information in the existing scans and participants files is retained whenever a conflict occurs.

snirf2bids.snirf2bids_recurse('<path to a directiory or path to snirf file>', 'list_files =<list of BIDS files to replace>', 'retain_old_info=True')

Export BIDS text files in JSON Format

s = snirf2bids.snirf2json('<path to snirf file>')  # Returns serialized JSON in which keys are filenames and values are their contents

Contributors

Developed by BU BME Senior Design Group 3 (2022): Christian Arthur, Jeonghoon Choi, Jiazhen Liu, Juncheng Zhang and the Boston University Neurophotonics Center.

@Christian Arthur 🍈
@Juncheng Zhang 🍊
@Jeonghoon Choi 🍍
@Jiazhen Liu 🍇

This project exists thanks to:

About

Python package for generating BIDS-fNIRS files from SNIRF files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages