[med-svn] [python-mne] 31/52: ENH : read volume source space info from fif

Yaroslav Halchenko debian at onerussian.com
Fri Nov 27 17:23:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

yoh pushed a commit to annotated tag v0.2
in repository python-mne.

commit b498e210e87db1e18baaf7bbc45c3134db21a78c
Author: Alexandre Gramfort <alexandre.gramfort at inria.fr>
Date:   Tue Oct 11 09:38:54 2011 -0400

    ENH : read volume source space info from fif
---
 mne/fiff/constants.py |  4 ++++
 mne/source_space.py   | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/mne/fiff/constants.py b/mne/fiff/constants.py
index d9a6d70..518b932 100644
--- a/mne/fiff/constants.py
+++ b/mne/fiff/constants.py
@@ -242,6 +242,10 @@ FIFF.FIFF_MNE_SOURCE_SPACE_NEAREST_DIST  = 3516  # Distance to the Nearest sourc
 FIFF.FIFF_MNE_SOURCE_SPACE_ID            = 3517  # Identifier
 FIFF.FIFF_MNE_SOURCE_SPACE_TYPE          = 3518  # Surface or volume
 
+FIFF.FIFF_MNE_SOURCE_SPACE_VOXEL_DIMS    = 3596  # Voxel space dimensions in a volume source space
+FIFF.FIFF_MNE_SOURCE_SPACE_INTERPOLATOR  = 3597  # Matrix to interpolate a volume source space into a mri volume
+FIFF.FIFF_MNE_SOURCE_SPACE_MRI_FILE      = 3598  # MRI file used in the interpolation
+
 FIFF.FIFF_MNE_SOURCE_SPACE_NTRI          = 3590  # Number of triangles
 FIFF.FIFF_MNE_SOURCE_SPACE_TRIANGLES     = 3591  # The triangulation
 FIFF.FIFF_MNE_SOURCE_SPACE_NUSE_TRI      = 3592  # Number of triangles corresponding to the number of vertices in use
diff --git a/mne/source_space.py b/mne/source_space.py
index 87eb3db..d9bca0e 100644
--- a/mne/source_space.py
+++ b/mne/source_space.py
@@ -132,6 +132,25 @@ def _read_one_source_space(fid, this):
         else:
             raise ValueError('Unknown source space type (%d)' % src_type)
 
+    if res['type'] == 'vol':
+
+        tag = find_tag(fid, this, FIFF.FIFF_MNE_SOURCE_SPACE_VOXEL_DIMS)
+        if tag is not None:
+            res['shape'] = tuple(tag.data)
+
+        tag = find_tag(fid, this, FIFF.FIFF_MNE_SOURCE_SPACE_INTERPOLATOR)
+        if tag is not None:
+            res['interpolator'] = tag.data
+
+        tag = find_tag(fid, this, FIFF.FIFF_COORD_TRANS)
+        if tag is not None:
+            res['mri_head_t'] = tag.data
+
+        tag = find_tag(fid, this, FIFF.FIFF_MNE_SOURCE_SPACE_MRI_FILE)
+        if tag is not None:
+            res['mri_file'] = tag.data
+
+
     tag = find_tag(fid, this, FIFF.FIFF_MNE_SOURCE_SPACE_NPOINTS)
     if tag is None:
         raise ValueError('Number of vertices not found')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-mne.git



More information about the debian-med-commit mailing list