Skip to content

Commit

Permalink
_format_dig_points return Digitization object
Browse files Browse the repository at this point in the history
  • Loading branch information
massich committed Jun 4, 2019
1 parent 4c38ef3 commit 7fae35a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mne/digitization/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from ..utils.check import _check_option
from .. import __version__

from .base import _format_dig_points, Digitization
from .base import _format_dig_points

b = bytes # alias

Expand Down Expand Up @@ -261,7 +261,7 @@ def _make_dig_points(nasion=None, lpa=None, rpa=None, hpi=None,
'kind': FIFF.FIFFV_POINT_EEG,
'coord_frame': FIFF.FIFFV_COORD_HEAD})

return Digitization(_format_dig_points(dig))
return _format_dig_points(dig)


def _call_make_dig_points(nasion, lpa, rpa, hpi, extra, convert=True):
Expand Down
3 changes: 2 additions & 1 deletion mne/digitization/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

def _format_dig_points(dig):
"""Format the dig points nicely."""
return [DigPoint(d) for d in dig] if dig is not None else dig
dig_points = [DigPoint(d) for d in dig] if dig is not None else dig
return Digitization(dig_points)


class DigPoint(dict):
Expand Down
3 changes: 1 addition & 2 deletions mne/io/ctf/ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from .constants import CTF

from ...digitization.base import _format_dig_points
from ...digitization import Digitization


@fill_doc
Expand Down Expand Up @@ -119,7 +118,7 @@ def __init__(self, directory, system_clock='truncate', preload=False,
# Compose a structure which makes fiff writing a piece of cake
info = _compose_meas_info(res4, coils, coord_trans, eeg)
info['dig'] += digs
info['dig'] = Digitization(_format_dig_points(info['dig']))
info['dig'] = _format_dig_points(info['dig'])
info['bads'] += _read_bad_chans(directory, info)

# Determine how our data is distributed across files
Expand Down
3 changes: 1 addition & 2 deletions mne/io/meas_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from ..transforms import invert_transform
from ..utils import logger, verbose, warn, object_diff, _validate_type
from ..digitization.base import _format_dig_points
from ..digitization import Digitization
from .compensator import get_current_comp

# XXX: most probably the functions needing this, should go somewhere else
Expand Down Expand Up @@ -1131,7 +1130,7 @@ def read_meas_info(fid, tree, clean_bads=False, verbose=None):
info['dev_ctf_t'] = Transform('meg', 'ctf_head', dev_ctf_trans)

# All kinds of auxliary stuff
info['dig'] = Digitization(_format_dig_points(dig))
info['dig'] = _format_dig_points(dig)
info['bads'] = bads
info._update_redundant()
if clean_bads:
Expand Down

0 comments on commit 7fae35a

Please sign in to comment.