mne-tools / mne-tools/mne-python

Converting from physical to digital values with FIF

Open
#5,750 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

For some calculations I need the original digital value that the signal was saved with for some integer calculation.

For EDF files I can calculate those from the physical and digital minimum/maximum that are saved in the header:

edf_raw = mne.io.read_raw_edf(...)
dmin = edf_raw._raw_extras[0]['digital_min'][ch_idx]
dmax = edf_raw._raw_extras[0]['digital_max'][ch_idx]
[...]
m = (dmax-dmin)/(pmax-pmin) 
digital = (m * signal).astype(int)

However, FIF files do not seem to contain such information.
Is it possible to get back to the original ADC values using FIF files?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the EDF conversion shown through mne.io.read_raw_edf, then inspect how FIF stores signal values and scaling metadata. Determine whether the original digital values can be retrieved; done means documenting a supported retrieval path or clearly recording that they cannot be recovered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.