# fiff data

**URL:** <https://mne.discourse.group/t/fiff-data/2141>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 7, 2020, 12:48pm UTC](https://mne.discourse.group/t/fiff-data/2141 "2020-04-07T12:48:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 7, 2020, 12:48pm UTC](https://mne.discourse.group/t/fiff-data/2141/1 "2020-04-07T12:48:30Z")

</div>

External Email - Use Caution

Hello,

Hope you are fine and in good health,

I would like to start from your example about the OPM-MEG data to solve our problem, kindly let me ask some questions:

1) How can I modify or generate the sensors file (size, distance, ....) to fit it to our sensors?  
We have some input information for generating this location file.  
All OPM will be placed in a radial orientation over the scalp surface as shown on the figure below,  
but each OPM will do measurement along X, Y an Z axis. Just, we applied a 90? rotation of each OPM in order to maximize the distance between High Frequency coils of the sensors, as shown below. Ths reduced the cross talk noise in our experimental setup. But placed over the scalp, due to the curvature of the scalp surface, these HF coils will be naturally distanced.  
[cid:5a3fc822-d26f-42ad-9e1c-dbfa1b9c91af]  
The size of OPM basis is 2 cm x 2cm (with its packaging) but the glass cell containing He atoms which are used to do the measurement is a circular glass cell of 1 cm diameter. The sensing volume has to be computed for the glass cell. The space between two OPM should be 5 mm. The distance between the OPM and the scalp can be set to 1 mm.

For our simulations, we will have to consider both cases :

&nbsp;&nbsp;\* the case ? 4 OPM ? (The 5th OPM is used for background noise measuremnt) over the scalp (these 4 OPM will be placed in an overhead position with respect the dipole location)  
&nbsp;&nbsp;\* for the case of a whole head OPM array and for this case, it can be derived from the SQUID

arrays by projecting the sensor locations to the scalp

2) We want to do simulation considering simple cases: radial dipole, tangential dipole + intermediate orientations, more or less deep dipole,...etc  
, is it possible to do the simulation in MNE python? if not I think we can do it in brainstorm, do you have tips how can we import this dataset of opm  
brainstorm?. In fact I started to open it in fieldtrip (fiff\_setup\_read\_raw) successfully open the raw file, but I did not successed to open the forward\_sample.fiff, do you have an idea? which function I should used. Beacuse I need to see the data, so that I can understand it and do the simulations.

3) Do you know what method is used to compute the forward model of the opm dataset you have? because as you know we are dealing here with free axis measurement, I asked in brainstorm discussion if we can use openmeeg to generate the leadfield in this case, but still searching for confirmation if we can use openmeeg in this case,

Thank you

Best regards  
Saeed

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 7, 2020, 2:50pm UTC](https://mne.discourse.group/t/fiff-data/2141/2 "2020-04-07T14:50:59Z")

</div>

External Email - Use Caution

You need to look at how we use:

[https://github.com/mne-tools/mne-python/blob/master/mne/data/coil\_def.dat](https://github.com/mne-tools/mne-python/blob/master/mne/data/coil_def.dat)

HTH  
Alex  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200407/463fa32f/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200407/463fa32f/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 7, 2020, 5:09pm UTC](https://mne.discourse.group/t/fiff-data/2141/3 "2020-04-07T17:09:06Z")

</div>

External Email - Use Caution

> 1) How can I modify or generate the sensors file (size, distance, ....) to  
> fit it to our sensors?

For this take a look at coil\_def.dat  
\<[https://github.com/mne-tools/mne-python/blob/master/mne/data/coil\_def.dat&gt;](https://github.com/mne-tools/mne-python/blob/master/mne/data/coil_def.dat&gt;),  
but also more critically the forward solution documentation of coil def  
\<[https://mne.tools/dev/overview/implementation.html#coil-geometry-information&gt;\](https://mne.tools/dev/overview/implementation.html#coil-geometry-information&gt;%5C).  
I'd recommend reading the entire forward section, it seems necessary for  
your work.  
\<[https://github.com/mne-tools/mne-python/blob/master/mne/data/coil\_def.dat&gt](https://github.com/mne-tools/mne-python/blob/master/mne/data/coil_def.dat&gt);

Also check out the custom `coil_def.dat` that comes with the OPM example.  
This, plus `info['chs'][ii]['loc']`, which produces a coil translation +  
rotation matrix using `mne.io.tag._loc_to_coil_trans`, is used to orient  
the sensors. Typically for SQUID MEG sensors these locations are stored in  
the MEG device coordinate frame, but it might make sense for your use case  
to figure out what they are (and store them) in the Neuromag head  
coordinate frame. I think that this might be done in the example (?), but  
note that their definition of the head coordinate frame is incorrect  
(instead of being defined by LPA/Nasion/RPA it's set to be equal to the MRI  
coordinate frame -- which is fine for the forward calculation, it just  
means that you shouldn't interpret any results in the "head" coordinate  
frame as being in the standard location/orientation). I think the forward  
code should already recognize that they are in head coordinates, but in  
case it does not, it would be safest to set `info['dev_head_t']` to an  
identity transform.

> 2) We want to do simulation considering simple cases: radial dipole,  
> tangential dipole + intermediate orientations, more or less deep  
> dipole,...etc  
> , is it possible to do the simulation in MNE python?

Yes, once you have the `modified_coil_def.dat`, set the `coil_type` and  
`loc` in `info['chs']` properly, you can use any forward computing  
functions you want from MNE, including the simulation code, as long as you  
are in the mne.use\_coil\_def context manager (as in the OPM example).

3) Do you know what method is used to compute the forward model of the opm

> dataset you have?

It's the same as in other parts of MNE, we use the linear collocation  
method (see for example Mosher et al 1999  
\<[https://ieeexplore.ieee.org/document/748978&gt;\](https://ieeexplore.ieee.org/document/748978&gt;%5C)). But perhaps this is not  
your question -- if you are asking if we compute the forward in all three  
orientations for each source location, this is what make\_forward\_solution  
will do. If you want just the normal direction of cortex you then use  
convert\_forward\_solution(..., force\_fixed=True).

Eric  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200407/c2abf2cf/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200407/c2abf2cf/attachment.html)
