Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Warn if untested NIRX device #7905

Merged
merged 2 commits into from
Jun 23, 2020
Merged

Conversation

rob-luke
Copy link
Member

@rob-luke rob-luke commented Jun 17, 2020

What does this implement/fix?

@cbrnr confirmed in #7894 that the NIRX format for saving data is not consistent across devices. I have only added test data for the NIRScout device I have access too. The function now throws a warning if used with an untested device.

Additional information

Next step is to improve the reader function to work with these alternative formats. But this warning seems prudent until someone with access to these devices adds reader support.

Closes #7913

@cbrnr
Copy link
Contributor

cbrnr commented Jun 17, 2020

This warning will not be raised for NIRSport2 devices, which do not generate a .hdr file in the first place. But it will work for NIRSport1 data.

Maybe it is sufficient to include a note in the docstring that we have currently tested the function only for NIRScout devices, and that NIRSport and NIRSport2 are WIP.

@cbrnr
Copy link
Contributor

cbrnr commented Jun 17, 2020

Also, maybe it would be a good idea to accept the .wl1 and/or .wl2 file as the file argument for the reader. These two files exists for all NIRX devices, so at least the refactored reader should change this from the current directory or the .hdr file.

@cbrnr
Copy link
Contributor

cbrnr commented Jun 17, 2020

Here are the files recorded with NIRSport2:

NIRSport2.zip

@rob-luke
Copy link
Member Author

I suggest larger rewrites to support additional devices be kept for another PR, and this is just a quick fix to inform users that we currently only support NIRScout devices. I’m happy with either a doc change or a warning or both. @larsoner what do you prefer

@rob-luke
Copy link
Member Author

Also CI failures seem unrelated and the decrease in code coverage is because we dont have test data in the repo yet.

@cbrnr
Copy link
Contributor

cbrnr commented Jun 17, 2020

And here are the files recorded with an old NIRSport device:

2014-04-22_001.zip

@larsoner
Copy link
Member

@rob-luke want to take a quick look and see if it's easy to support these files? If it only takes a week or two to get a PR in that allows to read them then let's just do that.

@rob-luke
Copy link
Member Author

@rob-luke want to take a quick look and see if it's easy to support these files?

Sorry I don't have the capacity to implement new file readers now. If someone who wants to use NIRSport devices implements a reader I will be happy to review a PR.

And here are the files recorded with an old NIRSport device:

Can we also get details of how the file was generated and the settings saved in the data? I think this is important to have to ensure we extract the correct values from the data, otherwise we are just assuming we interpret the file format correctly. Here is an example of the minimum information I think is required... mne-tools/mne-testing-data#51

@rob-luke
Copy link
Member Author

Also integrates comments from #7913

@larsoner
Copy link
Member

CircleCI is unrelated. Let's get this in and we can relax the warning once someone gets a chance to work on the other reader. @cbrnr do you want to give it a shot at some point, incorporating @rob-luke's suggestion above about what files are helpful to have?

@larsoner larsoner merged commit e4ace23 into mne-tools:master Jun 23, 2020
@cbrnr
Copy link
Contributor

cbrnr commented Jun 23, 2020

Yes, I'll see what I can do. It doesn't seem to be too complicated, but I need to finish some other tasks before I can start working on that. I'll create an issue to remind myself.

larsoner added a commit to larsoner/mne-python that referenced this pull request Jun 23, 2020
* upstream/master:
  MRG, ENH: Add method to project onto max power ori (mne-tools#7883)
  WIP: Warn if untested NIRX device (mne-tools#7905)
  MRG, BUG: Fix bug with volume morph and subject_to!="fsaverage" (mne-tools#7896)
  MRG, MAINT: Clean up use of bool, float, int (mne-tools#7917)
  ENH: Better error message for incompatible Evoked objects (mne-tools#7910)
  try to fix nullcontext (mne-tools#7908)
larsoner added a commit to larsoner/mne-python that referenced this pull request Jun 25, 2020
* upstream/master: (23 commits)
  MAINT: Add mne.surface to docstring tests (mne-tools#7930)
  MRG: Add smoothing controller to TimeViewer for the notebook backend (mne-tools#7928)
  MRG: TimeViewer matplotlib figure color (mne-tools#7925)
  fix typos (mne-tools#7924)
  MRG, ENH: Add method to project onto max power ori (mne-tools#7883)
  WIP: Warn if untested NIRX device (mne-tools#7905)
  MRG, BUG: Fix bug with volume morph and subject_to!="fsaverage" (mne-tools#7896)
  MRG, MAINT: Clean up use of bool, float, int (mne-tools#7917)
  ENH: Better error message for incompatible Evoked objects (mne-tools#7910)
  try to fix nullcontext (mne-tools#7908)
  WIP: Fix Travis (mne-tools#7906)
  WIP: Prototype of notebook viz (screencast) (mne-tools#7758)
  MRG, FIX: Speed up I/O tests, mark some slow (mne-tools#7904)
  Proper attribution for Blender tutorial (mne-tools#7900)
  MAINT: Check usage [ci skip] (mne-tools#7902)
  Allow find_bad_channels_maxwell() to return scores (mne-tools#7845)
  Warn if NIRx directory structure has been modified from original format (mne-tools#7898)
  Pin pvyista to 0.24.3 (mne-tools#7899)
  MRG: Add support for reading and writing sufaces to .obj (mne-tools#7824)
  Fix _auto_topomap_coords docstring. (mne-tools#7895)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fNIRS] Misleading error message when the raw_data path does not exist
3 participants