converting mat. or ...
Clear all

converting mat. or csv. files into snirf.

Nahyun Lee
Posts: 1
Topic starter
New Member
Joined: 4 months ago

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? 


1 Reply
Stephen Tucker
Posts: 52
Trusted Member
Joined: 2 years ago

Hi Nahyun,


.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:


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: