MNE Python for fNIRS? #3539

Closed
mcaffini opened this Issue Aug 29, 2016 · 26 comments

Comments

Projects
None yet
5 participants
@mcaffini

Hi all,

I successfully tested some of the MNE Python methods and classes in my fNIRS data processing workflow.
I wonder if anyone else is interested in this and whether it's worth to write some code in this direction. I can also swallow the bitter pill and keep labeling my fNIRS data as "eeg", but maybe we could seize the day to start something useful. Happy to share more of what I did if needed.

Let's discuss it! :-)

@larsoner

This comment has been minimized.

Show comment
Hide comment
@larsoner

larsoner Aug 29, 2016

Member

I see no problem with asking to add a fNIRS channel type to the FIF tags and making the appropriate adjustments in our code. @agramfort @jaeilepp do you agree?

Member

larsoner commented Aug 29, 2016

I see no problem with asking to add a fNIRS channel type to the FIF tags and making the appropriate adjustments in our code. @agramfort @jaeilepp do you agree?

@larsoner larsoner added this to the 0.13 milestone Aug 29, 2016

@larsoner

This comment has been minimized.

Show comment
Hide comment
@larsoner

larsoner Aug 29, 2016

Member

@mcaffini do you have some small data file that you can share? What format is it?

Member

larsoner commented Aug 29, 2016

@mcaffini do you have some small data file that you can share? What format is it?

@jaeilepp

This comment has been minimized.

Show comment
Hide comment
@jaeilepp

jaeilepp Aug 29, 2016

Contributor

Sure, why not.

Contributor

jaeilepp commented Aug 29, 2016

Sure, why not.

@larsoner

This comment has been minimized.

Show comment
Hide comment
@larsoner

larsoner Aug 29, 2016

Member
Member

larsoner commented Aug 29, 2016

@agramfort

This comment has been minimized.

Show comment
Hide comment
@agramfort

agramfort Aug 29, 2016

Member
Member

agramfort commented Aug 29, 2016

@mcaffini

This comment has been minimized.

Show comment
Hide comment
@mcaffini

mcaffini Sep 1, 2016

Dear all, sorry for the late reply.
@Eric89GXL I use the ISS Imagent. fNIRS raw data come from different technologies (continuous wave, frequency domain, time domain) and each instruments has its own format, but they all eventually get transformed into oxyhemoglobin (HbO) and deoxyhemoglobin (HbR) concentrations (this transformation process is different for different technologies). Maybe we skip this step and we directly start from a numpy array containing the concentrations? This way we would only need two tags like fNIRS-HbO and fNIRS-HbR...

mcaffini commented Sep 1, 2016

Dear all, sorry for the late reply.
@Eric89GXL I use the ISS Imagent. fNIRS raw data come from different technologies (continuous wave, frequency domain, time domain) and each instruments has its own format, but they all eventually get transformed into oxyhemoglobin (HbO) and deoxyhemoglobin (HbR) concentrations (this transformation process is different for different technologies). Maybe we skip this step and we directly start from a numpy array containing the concentrations? This way we would only need two tags like fNIRS-HbO and fNIRS-HbR...

@jaeilepp

This comment has been minimized.

Show comment
Hide comment
@jaeilepp

jaeilepp Sep 1, 2016

Contributor

Maybe we skip this step and we directly start from a numpy array containing the concentrations?

Sounds reasonable. We probably don't want to provide the 'preprocessing' steps for this transformation anyway.

Contributor

jaeilepp commented Sep 1, 2016

Maybe we skip this step and we directly start from a numpy array containing the concentrations?

Sounds reasonable. We probably don't want to provide the 'preprocessing' steps for this transformation anyway.

@jaeilepp

This comment has been minimized.

Show comment
Hide comment
@jaeilepp

jaeilepp Sep 1, 2016

Contributor

Actually, it sounds like we would need a tag for fNIRS channel type and for two units (HbO and HbR). Am I right?

Contributor

jaeilepp commented Sep 1, 2016

Actually, it sounds like we would need a tag for fNIRS channel type and for two units (HbO and HbR). Am I right?

@mcaffini

This comment has been minimized.

Show comment
Hide comment
@mcaffini

mcaffini Sep 1, 2016

What do you mean with unit? If you have in mind each channel having two independent tracks/signals (HbO and HbR), that sounds good!

mcaffini commented Sep 1, 2016

What do you mean with unit? If you have in mind each channel having two independent tracks/signals (HbO and HbR), that sounds good!

@larsoner

This comment has been minimized.

Show comment
Hide comment
@larsoner

larsoner Sep 1, 2016

Member

Physical units, preferably of the SI variety -- for EEG it's V (commonly viewes as uV) and for MEG it's T and T/m (more commonly viewed as fT / fT/cm).

Member

larsoner commented Sep 1, 2016

Physical units, preferably of the SI variety -- for EEG it's V (commonly viewes as uV) and for MEG it's T and T/m (more commonly viewed as fT / fT/cm).

@mcaffini

This comment has been minimized.

Show comment
Hide comment
@mcaffini

mcaffini Sep 1, 2016

OK, then for fNIRS is molar concentration (M=mol/l=mol/dm3, usually as μM, proper SI unit would be mol/m3). Each channel gives two independent signals (HbO and HbR) with the same unit (μM). How do we refer to each one separately?

mcaffini commented Sep 1, 2016

OK, then for fNIRS is molar concentration (M=mol/l=mol/dm3, usually as μM, proper SI unit would be mol/m3). Each channel gives two independent signals (HbO and HbR) with the same unit (μM). How do we refer to each one separately?

@jaeilepp

This comment has been minimized.

Show comment
Hide comment
@jaeilepp

jaeilepp Sep 1, 2016

Contributor

Ok, yeah. I'm thinking that maybe we need just one channel type with two kinds (like we have with MEG channels mag and grad). Makes sense? Although it might be the easier to have just two types. Not sure which is better.

Contributor

jaeilepp commented Sep 1, 2016

Ok, yeah. I'm thinking that maybe we need just one channel type with two kinds (like we have with MEG channels mag and grad). Makes sense? Although it might be the easier to have just two types. Not sure which is better.

@mcaffini

This comment has been minimized.

Show comment
Hide comment
@mcaffini

mcaffini Sep 1, 2016

One type with two kinds makes more sense to me. That way you can pick all HbO with 'hbo', all HbR with 'hbr', or both with 'fnirs' (no caps to be consistent with the other tags?), the same way you pick magnetometers with 'mag', gradiometers with 'grad', ... or everything MEG with 'meg'. Adding total hemoglobin (HbT or hbt) is trivial (but not necessary) being the algebraic sum of HbO and HbR.

In http://martinos.org/mne/stable/generated/mne.pick_types.html would it look like this?

[...]
meg : bool or string
If True include all MEG channels. If False include None. If string it can be 'mag', 'grad', 'planar1' or 'planar2' to select only magnetometers, all gradiometers, or a specific type of gradiometer.

fnirs: bool or string
If True include all fNIRS channels. If False include None. If string it can be 'hbo', 'hbr', 'hbt' to select only oxyhemoglobin, deoxyhemoglobin, or total hemoglobin (algebraic sum of hbo and hbr).
[...]

mcaffini commented Sep 1, 2016

One type with two kinds makes more sense to me. That way you can pick all HbO with 'hbo', all HbR with 'hbr', or both with 'fnirs' (no caps to be consistent with the other tags?), the same way you pick magnetometers with 'mag', gradiometers with 'grad', ... or everything MEG with 'meg'. Adding total hemoglobin (HbT or hbt) is trivial (but not necessary) being the algebraic sum of HbO and HbR.

In http://martinos.org/mne/stable/generated/mne.pick_types.html would it look like this?

[...]
meg : bool or string
If True include all MEG channels. If False include None. If string it can be 'mag', 'grad', 'planar1' or 'planar2' to select only magnetometers, all gradiometers, or a specific type of gradiometer.

fnirs: bool or string
If True include all fNIRS channels. If False include None. If string it can be 'hbo', 'hbr', 'hbt' to select only oxyhemoglobin, deoxyhemoglobin, or total hemoglobin (algebraic sum of hbo and hbr).
[...]

@agramfort

This comment has been minimized.

Show comment
Hide comment
@agramfort

agramfort Sep 1, 2016

Member
Member

agramfort commented Sep 1, 2016

@agramfort

This comment has been minimized.

Show comment
Hide comment
@agramfort

agramfort Sep 15, 2016

Member

@jaeilepp what did we converge on regarding fif constants?

Member

agramfort commented Sep 15, 2016

@jaeilepp what did we converge on regarding fif constants?

@jaeilepp

This comment has been minimized.

Show comment
Hide comment
@jaeilepp

jaeilepp Sep 15, 2016

Contributor

No response from Elekta yet.

Contributor

jaeilepp commented Sep 15, 2016

No response from Elekta yet.

@jaeilepp

This comment has been minimized.

Show comment
Hide comment
@jaeilepp

jaeilepp Sep 16, 2016

Contributor

Here they are:

fnirs_hbo 300  "FNIRS oxyhemoglobin"
fnirs_hbr 301  "FNIRS deoxyhemoglobin"
fnirs 1100 "Functional near-infrared spectroscopy"
FIFF.FIFFV_FNIRS_CH     = 1100
Contributor

jaeilepp commented Sep 16, 2016

Here they are:

fnirs_hbo 300  "FNIRS oxyhemoglobin"
fnirs_hbr 301  "FNIRS deoxyhemoglobin"
fnirs 1100 "Functional near-infrared spectroscopy"
FIFF.FIFFV_FNIRS_CH     = 1100
@agramfort

This comment has been minimized.

Show comment
Hide comment
@agramfort

agramfort Sep 16, 2016

Member
Member

agramfort commented Sep 16, 2016

@agramfort

This comment has been minimized.

Show comment
Hide comment
@agramfort

agramfort Apr 15, 2017

Member

@mcaffini there is a new public dataset with EEG + NIRS:

https://www.depositonce.tu-berlin.de/handle/11303/6271

maybe a good way to have a first example of NIRS with MNE?

Member

agramfort commented Apr 15, 2017

@mcaffini there is a new public dataset with EEG + NIRS:

https://www.depositonce.tu-berlin.de/handle/11303/6271

maybe a good way to have a first example of NIRS with MNE?

@mcaffini

This comment has been minimized.

Show comment
Hide comment
@mcaffini

mcaffini Apr 15, 2017

Thanks @agramfort very interesting, I'll give it a shot.
I have completed my fNIRS analysis with MNE and I have also coded the source space reconstruction using a Monte Carlo method for the forward solution.
Still interested in a tutorial for the MNE website?

Thanks @agramfort very interesting, I'll give it a shot.
I have completed my fNIRS analysis with MNE and I have also coded the source space reconstruction using a Monte Carlo method for the forward solution.
Still interested in a tutorial for the MNE website?

@dengemann

This comment has been minimized.

Show comment
Hide comment
@dengemann

dengemann Apr 15, 2017

Member
Member

dengemann commented Apr 15, 2017

@agramfort

This comment has been minimized.

Show comment
Hide comment
@agramfort

agramfort Apr 16, 2017

Member
Member

agramfort commented Apr 16, 2017

@mcaffini

This comment has been minimized.

Show comment
Hide comment
@mcaffini

mcaffini May 9, 2017

I prepared a Jupyter notebook tutorial with basic fNIRS data analysis, here. Of course comments and suggestions are more then welcome. :-)

mcaffini commented May 9, 2017

I prepared a Jupyter notebook tutorial with basic fNIRS data analysis, here. Of course comments and suggestions are more then welcome. :-)

@agramfort

This comment has been minimized.

Show comment
Hide comment
@agramfort

agramfort May 10, 2017

Member
Member

agramfort commented May 10, 2017

@mcaffini

This comment has been minimized.

Show comment
Hide comment
@mcaffini

mcaffini May 10, 2017

@agramfort the notebook as well as the npy file with data should be downloadable for testing from my repo. The provided dataset comes from my lab and is real data, but we can change dataset and fetch it online, no problem.
Btw, I don't see any boilerplate code (apart from numpy.load :-D).

@agramfort the notebook as well as the npy file with data should be downloadable for testing from my repo. The provided dataset comes from my lab and is real data, but we can change dataset and fetch it online, no problem.
Btw, I don't see any boilerplate code (apart from numpy.load :-D).

@agramfort

This comment has been minimized.

Show comment
Hide comment
@agramfort

agramfort May 10, 2017

Member
Member

agramfort commented May 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment