Skip to main content

To convert snirf file to bids format.

Project description

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 :melon:
@Juncheng Zhang :tangerine:
@Jeonghoon Choi :pineapple:
@Jiazhen Liu :grapes:

This project exists thanks to:

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

snirf2bids-0.8.7.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

snirf2bids-0.8.7-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file snirf2bids-0.8.7.tar.gz.

File metadata

  • Download URL: snirf2bids-0.8.7.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for snirf2bids-0.8.7.tar.gz
Algorithm Hash digest
SHA256 804f2c9b5f02dbf61dbac29579169815f56f539511cd17d6a770a7eb23ede0a0
MD5 bdaf5786a099d90150dfa3e9d8e54e06
BLAKE2b-256 e76010d3ce0b87c0e3dd4b9906ccfbf005f82419ad27c34b79341a05b758b8a9

See more details on using hashes here.

File details

Details for the file snirf2bids-0.8.7-py3-none-any.whl.

File metadata

  • Download URL: snirf2bids-0.8.7-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for snirf2bids-0.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7904284f1bd1df00dac0eced143b79101d6db5d84e31556fa3f2974eff54c17c
MD5 7ceb169a1edebbe507440b5d7fd61a32
BLAKE2b-256 f019c3a1754395ea07fb76b9c9656f418ce8cc11aeaf3a6aee942adfff93eed4

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