Add example snirf file#68
Conversation
Created from nirx recording with same name
|
This is kind of a WIP standard, right? With opening an issue to get them to at least include the original 3D positions as well? I find it very surprising they'd voluntarily reduce the information in conversion to a file type they are in the process of defining. :( But either way if they plan to produce some files with only this information I guess we do need to figure out how to project 2D back to 3D... |
|
I think I confused a few different issues in my description above, sorry let me try and clarify. I think I wasn't clear on the two step procedure to create this file. Step one is converting NIRX to .nirs format. Step two is converting the .nirs file to SNIRF and writing the SNIRF file to disk. We are interested mainly in step two and making sure we read back the same information that was written to disk. I used the nirx to nirs procedure for step 1 simply because that's test data we already have and can compare to to easily in the tests, but step one isn't really that meaningful as people could just use our nirx reader.
The SNIRF standard is complete, the first version was released in 2019 (reference). It's currently at version 1.3 and they are about to progress the spec to draft 1.4. This raises a good point that I should make the version clear in the filename, I will rename the file in this PR to include Some vendors already export in SNIRF format. For example, NIRX exports their NIRSport2 devices with SNIRF format and they have kindly sent me some files, but they are too large to put in for unit tests. Until everyone gets new devices that export in snirf the majority of users will use the snirf converter provided by the fnirs society, so that's what I have used here. BIDS for NIRS is a WIP. However, SNIRF will 100% be the supported file format.
The SNIRF format does not cause the loss of location information, it is the However, I don't consider the NIRX to nirs issue a concern here. We want to add support for reading SNIRF files which is vendor agnostic. This PR is to add a simple test file with known information. How different manufacturers encode location in to their SNIRF files will vary. To start with we want to just make sure we are faithfully reading what is stored in the file, so I considered the precise coding of locations tangential. We know the location information that is in the snirf file (its printed above), we just need to ensure this is read correctly by our reader. But if you prefer I can use my hacked version of The 3D positions stored in this file aren't very meaningful, but that's not the focus of the test file. Similarly the data itself isn't meaningful (its just room noise). What I thought was important for the test file was that we know what's in it, and that we read it correctly and that the file size is not too large. I guess I opted for reproducibility over meaningful 3d locations, but happy to switch if you prefer.
Yeah this is an issue with the NIRX to nirs converter, its also appears to not be a static transformation but an adaptive iterative approach per file, so I don't know if its even possible to reverse. If people want to use NIRX data with correct 3d locations then they should just use our |
No I agree it makes sense to use the data that standard files produce.
Okay good to know that some of the conversion tools are non-lossy at least :) |
|
Thanks! |
SNIRF is the new standard file format for NIRS data. It will become the official BIDS file format.
This file was created in MATLAB from the existing nirx file with the same name.
The nirx file was converted to .nirs using the
HomerOfflineConverterscript provided by NIRX (unable to share, this is behind their password section, but anyone with a machine can get access). Then I ran the .nirs to .snirf conversion as specified at https://github.com/fNIRS/snirf_homer3Here is the script used for the creation of this file
I chose to use one of our existing files to convert because then we can check against the original in the tests. However, there is one change caused by the conversion. The
HomerOfflineConverterscript modifies the source and detector locations and projects them to a 2D(ish) set of positions. I considered using a modified custom version ofHomerOfflineConverter, but decided against as then my creation of this file would then not be reproducible. Instead I have included the modified source detector locations below, and these values will be used in the tests for the file reader.