Forum

Notifications
Clear all

Batch editing stimulus markers/triggers in Homer3


justanothernoobuser
Posts: 2
Customer
Topic starter
(@justanothernoobuser)
New Member
Joined: 3 months ago

Dear All

My fNIRS data is saved in a .nirs file and it has an excessive amount of triggers (more than what I need for my analysis). So, I would like to remove these additional triggers in Homer3 but it is extremely tedious to remove each trigger individually. May I know if there is a way of batch removing/editing these unwanted triggers?

Thank you. 

4 Replies
David Boas
Posts: 168
Registered
(@dboas)
Estimable Member
Joined: 1 year ago

You have to write a program to load the snirf file, modify the stim marks, and then save the snirf file.

Homer has functions for loading and saving snirf files in matlab.

The SNIRF repository on github also points to python code for doing the same.

Hopefully you can find this info on our github wikis. If not I can pull up the links.

But maybe you can't program this stuff yourself and are looking for a non-programming solution.

Reply
1 Reply
justanothernoobuser
Customer
(@justanothernoobuser)
Joined: 3 months ago

New Member
Posts: 2

@dboas Thank you for this suggestion! I will try it out and let you know if it works.

Reply
David Boas
Posts: 168
Registered
(@dboas)
Estimable Member
Joined: 1 year ago

You can learn about loading and saving snirf files in matlab using the homer functions on the wiki here.

Description of the snirf spec on github is here to help guide through the structure that homer will load into matlab. It is not a direct relationship between the homer data structure loaded from a snirf file, but it is pretty close. Homer saves the snirf file according to this spec.

Let us know how it works out for you and share your code for others to benefit. This is a common problem for people.

We've been thinking of supporting the export and import and CSV files for easily editting stim onsets in stimGUI. Would be great if you wanted to make that happen in Homer!

Reply
Justin Hudak
Posts: 2
Customer
(@jphudak123)
New Member
Joined: 11 months ago

Hi, Any luck with this? The problem that I find when trying to edit triggers in SNIRF files is that the editing of one StimClass object changes all of them under snirf.stim. Apparently this is native MATLAB functionality? Any ideas on how to work around this? 

Reply
Share: