# sensor geometries

**URL:** <https://mne.discourse.group/t/sensor-geometries/576>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 24, 2013, 5:17pm UTC](https://mne.discourse.group/t/sensor-geometries/576 "2013-04-24T17:17:42Z")\
**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 24, 2013, 5:17pm UTC](https://mne.discourse.group/t/sensor-geometries/576/1 "2013-04-24T17:17:42Z")

</div>

Hi all,

A collaborator I am working with is interested in using information  
about the geometry of the MEG sensors for a custom visualization. As I  
understand it, a sensor geometry is a numerical description of the  
spatial relationships among the MEG sensors. Could anyone tell me where  
I can access this information?

Thanks,

Matt

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20130424/46bfbc5e/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20130424/46bfbc5e/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 24, 2013, 6:15pm UTC](https://mne.discourse.group/t/sensor-geometries/576/2 "2013-04-24T18:15:14Z")

</div>

Matt,

What information do you need? Just the location? If so, the information  
is in the measurement information. Have a look at this example:

[http://martinos.org/mne/auto\_examples/connectivity/plot\_sensor\_connectivity.html](http://martinos.org/mne/auto_examples/connectivity/plot_sensor_connectivity.html)

The orientation of the sensors is also stored, but I'm not sure how to  
get that information. Maybe someone else can shed some light on this.

Best,

Martin

---

<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 24, 2013, 6:21pm UTC](https://mne.discourse.group/t/sensor-geometries/576/3 "2013-04-24T18:21:36Z")

</div>

Hi Matt,

Here you go, sample matlab code for this is below

Sheraz

%------------------------------------------------------------------  
in\_fif\_File='Any\_fif\_File.fif';  
[fiffsetup] = fiff\_setup\_read\_raw(in\_fif\_File);  
chs=fiffsetup.info.chs(1:306);

for k=1:306

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chpos=chs(k).loc(1:3);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chxdir=chs(k).loc(4:6);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chydir=chs(k).loc(7:9);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chzdir=chs(k).loc(10:12);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sensors(k).pos=[chpos; 1];  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sensors(k).xdir=chxdir;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sensors(k).xdir=sensors(k).xdir./norm(sensors(k).xdir);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sensors(k).ydir=chydir;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sensors(k).ydir=sensors(k).ydir./norm(sensors(k).ydir);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sensors(k).zdir=chzdir;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sensors(k).zdir=sensors(k).zdir./norm(sensors(k).zdir);

end

%------------------------------------------------------------------
