Forum

converting mat. or ...
 
Notifications
Clear all

converting mat. or csv. files into snirf.

2 Posts
2 Users
0 Likes
1,071 Views
Posts: 1
Topic starter
(@erialc)
New Member
Joined: 2 years 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? 

Thanks,

1 Reply
Posts: 52
(@sstucker)
Joined: 3 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: 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

Reply
Share:
en_USEnglish