converting mat. or csv. files into snirf.
Hello, I am an undergraduate student working on a project to build a pre-processing code sets for a fNIRS instrument NIRSIT.
They provide file formats in csv. and mat., and I want to convert them into nirs. or snirf. format to utilize various codes shared online for fnirs data analysis.
Does anyone know how to change mat. files into snirf. format?
.mat nor .csv files are directly convertible to SNIRF format, unless the .mat file happens to follow the .nirs convention, in which case Homer3 can convert it:
snirf = SnirfClass(NirsClass(<path to .mat /.nirs file>))
But depending on where the source data is coming from, I doubt the above code will work. Please see the SNIRF file specification document for information about how to write SNIRF files: https://github.com/fNIRS/snirf/blob/master/snirf_specification.md
There is example code in the repository which demonstrates how to write SNIRF file fields in MATLAB and Python.
If you are building an app in Python 3 or wish to validate the SNIRF files you are generating, see the Python package pysnirf2: https://github.com/sstucker/pysnirf2