diff --git a/mne/bem.py b/mne/bem.py index a4d4b55727e..b80b5315491 100644 --- a/mne/bem.py +++ b/mne/bem.py @@ -16,7 +16,7 @@ from scipy import linalg from .io.constants import FIFF, FWD -from .digitization.base import _dig_kind_dict, _dig_kind_rev, _dig_kind_ints +from ._digitization.base import _dig_kind_dict, _dig_kind_rev, _dig_kind_ints from .io.write import (start_file, start_block, write_float, write_int, write_float_matrix, write_int_matrix, end_block, end_file) diff --git a/mne/channels/_dig_montage_utils.py b/mne/channels/_dig_montage_utils.py index bb1dbd9edde..f331e4d9160 100644 --- a/mne/channels/_dig_montage_utils.py +++ b/mne/channels/_dig_montage_utils.py @@ -19,7 +19,7 @@ from ..io.constants import FIFF from ..io.open import fiff_open -from ..digitization._utils import _read_dig_fif +from .._digitization._utils import _read_dig_fif from ..utils import _check_fname, Bunch, warn diff --git a/mne/channels/montage.py b/mne/channels/montage.py index 4264e624cc8..9b9bf446457 100644 --- a/mne/channels/montage.py +++ b/mne/channels/montage.py @@ -22,9 +22,9 @@ from .channels import _contains_ch_type from ..transforms import (apply_trans, get_ras_to_neuromag_trans, _sph_to_cart, _topo_to_sph, _str_to_frame, _frame_to_str) -from ..digitization import Digitization -from ..digitization._utils import (_make_dig_points, _read_dig_points, - write_dig) +from .._digitization import Digitization +from .._digitization._utils import (_make_dig_points, _read_dig_points, + write_dig) from ..io.pick import pick_types from ..io.constants import FIFF from ..utils import (warn, copy_function_doc_to_method_doc, @@ -710,6 +710,7 @@ def save(self, fname): raise RuntimeError('Can only write out digitization points in ' 'head coordinates.') write_dig(fname, self.dig) + # XXX: This is broken, as it only saves dig and not ch_names @property def dig_ch_pos(self): diff --git a/mne/channels/tests/test_montage.py b/mne/channels/tests/test_montage.py index 745a32e1795..bde7a06afb4 100644 --- a/mne/channels/tests/test_montage.py +++ b/mne/channels/tests/test_montage.py @@ -28,8 +28,8 @@ from mne.bem import _fit_sphere from mne.transforms import apply_trans, get_ras_to_neuromag_trans from mne.io.constants import FIFF -from mne.digitization import Digitization -from mne.digitization._utils import _read_dig_points +from mne._digitization import Digitization +from mne._digitization._utils import _read_dig_points from mne.viz._3d import _fiducial_coords from mne.io.kit import read_mrk diff --git a/mne/gui/_kit2fiff_gui.py b/mne/gui/_kit2fiff_gui.py index 22aca13d9b7..d8608986dab 100644 --- a/mne/gui/_kit2fiff_gui.py +++ b/mne/gui/_kit2fiff_gui.py @@ -13,7 +13,7 @@ from scipy.linalg import inv from threading import Thread -from ..digitization._utils import _read_dig_points, _make_dig_points +from .._digitization._utils import _read_dig_points, _make_dig_points from ..utils import get_config, set_config, logger, warn from mayavi.core.ui.mayavi_scene import MayaviScene diff --git a/mne/gui/_marker_gui.py b/mne/gui/_marker_gui.py index be1fde4a76b..7eafdb7dea8 100644 --- a/mne/gui/_marker_gui.py +++ b/mne/gui/_marker_gui.py @@ -20,7 +20,7 @@ from ..transforms import apply_trans, rotation, translation from ..coreg import fit_matched_points from ..io.kit import read_mrk -from ..digitization._utils import _write_dig_points +from .._digitization._utils import _write_dig_points from ._viewer import PointObject from ._backend import _check_pyface_backend diff --git a/mne/io/artemis123/artemis123.py b/mne/io/artemis123/artemis123.py index ba1f9d23aee..861ba1630a9 100644 --- a/mne/io/artemis123/artemis123.py +++ b/mne/io/artemis123/artemis123.py @@ -12,7 +12,7 @@ from ..utils import _read_segments_file from ..base import BaseRaw from ..meas_info import _empty_info -from ...digitization._utils import _make_dig_points +from ..._digitization._utils import _make_dig_points from ..constants import FIFF from ...chpi import _fit_device_hpi_positions, _fit_coil_order_dev_head_trans from ...transforms import get_ras_to_neuromag_trans, apply_trans, Transform diff --git a/mne/io/artemis123/utils.py b/mne/io/artemis123/utils.py index ae2de31975f..61858a5559d 100644 --- a/mne/io/artemis123/utils.py +++ b/mne/io/artemis123/utils.py @@ -2,7 +2,7 @@ import os.path as op from ...utils import logger from ...transforms import rotation3d_align_z_axis -from ...digitization._utils import _artemis123_read_pos +from ..._digitization._utils import _artemis123_read_pos def _load_mne_locs(fname=None): diff --git a/mne/io/bti/bti.py b/mne/io/bti/bti.py index dc4d8e82dd4..eb18481e2de 100644 --- a/mne/io/bti/bti.py +++ b/mne/io/bti/bti.py @@ -989,7 +989,7 @@ def _read_segment_file(self, data, idx, fi, start, stop, cals, mult): def _make_bti_digitization( info, head_shape_fname, convert, use_hpi, bti_dev_t, dev_ctf_t): - from ...digitization._utils import _make_bti_dig_points + from ..._digitization._utils import _make_bti_dig_points if head_shape_fname: logger.info('... Reading digitization points from %s' % diff --git a/mne/io/bti/tests/test_bti.py b/mne/io/bti/tests/test_bti.py index a6082bf7d89..de57d18ba95 100644 --- a/mne/io/bti/tests/test_bti.py +++ b/mne/io/bti/tests/test_bti.py @@ -14,7 +14,7 @@ from mne.datasets import testing from mne.io import read_raw_fif, read_raw_bti -from mne.digitization._utils import _make_bti_dig_points +from mne._digitization._utils import _make_bti_dig_points from mne.io.bti.bti import (_read_config, _read_bti_header, _get_bti_dev_t, _correct_trans, _get_bti_info, diff --git a/mne/io/ctf/ctf.py b/mne/io/ctf/ctf.py index 1ddb30d01bc..aba9a1f4c58 100644 --- a/mne/io/ctf/ctf.py +++ b/mne/io/ctf/ctf.py @@ -22,7 +22,7 @@ from .constants import CTF from .markers import _read_annotations_ctf_call -from ...digitization.base import _format_dig_points +from ..._digitization.base import _format_dig_points @fill_doc diff --git a/mne/io/kit/coreg.py b/mne/io/kit/coreg.py index 87d14ed83da..8e2332b694e 100644 --- a/mne/io/kit/coreg.py +++ b/mne/io/kit/coreg.py @@ -12,7 +12,7 @@ import numpy as np from .constants import KIT -from ...digitization._utils import _read_dig_points +from ..._digitization._utils import _read_dig_points def read_mrk(fname): diff --git a/mne/io/kit/kit.py b/mne/io/kit/kit.py index ce5707c57e1..842ae83f7b0 100644 --- a/mne/io/kit/kit.py +++ b/mne/io/kit/kit.py @@ -29,7 +29,7 @@ from .coreg import read_mrk from ...event import read_events -from ...digitization._utils import _set_dig_kit +from ..._digitization._utils import _set_dig_kit def _call_digitization(info, mrk, elp, hsp): diff --git a/mne/io/kit/tests/test_coreg.py b/mne/io/kit/tests/test_coreg.py index 79b0c8f98d6..d50c86157a1 100644 --- a/mne/io/kit/tests/test_coreg.py +++ b/mne/io/kit/tests/test_coreg.py @@ -10,7 +10,7 @@ from numpy.testing import assert_array_equal from mne.io.kit import read_mrk -from mne.digitization._utils import _write_dig_points +from mne._digitization._utils import _write_dig_points from mne.utils import _TempDir diff --git a/mne/io/meas_info.py b/mne/io/meas_info.py index 3080a74d8b6..15ad7113a2e 100644 --- a/mne/io/meas_info.py +++ b/mne/io/meas_info.py @@ -29,12 +29,13 @@ from .proc_history import _read_proc_history, _write_proc_history from ..transforms import invert_transform from ..utils import logger, verbose, warn, object_diff, _validate_type -from ..digitization.base import _format_dig_points +from .._digitization.base import _format_dig_points from .compensator import get_current_comp # XXX: most probably the functions needing this, should go somewhere else -from ..digitization.base import _dig_kind_proper, _dig_kind_rev, _dig_kind_ints -from ..digitization._utils import _read_dig_fif +from .._digitization.base import _dig_kind_proper, _dig_kind_rev +from .._digitization.base import _dig_kind_ints +from .._digitization._utils import _read_dig_fif b = bytes # alias @@ -667,7 +668,7 @@ def write_fiducials(fname, pts, coord_frame=FIFF.FIFFV_COORD_UNKNOWN, mne.io.constants.FIFF.FIFFV_COORD_...). %(verbose)s """ - from ..digitization._utils import write_dig as ff + from .._digitization._utils import write_dig as ff ff(fname, pts, coord_frame) @@ -686,7 +687,7 @@ def write_dig(fname, pts, coord_frame=None): here. Can be None (default) if the points could have varying coordinate frames. """ - from ..digitization._utils import write_dig as ff + from .._digitization._utils import write_dig as ff return ff(fname, pts, coord_frame=None) diff --git a/mne/io/tests/test_meas_info.py b/mne/io/tests/test_meas_info.py index b1b98786d74..52433477d70 100644 --- a/mne/io/tests/test_meas_info.py +++ b/mne/io/tests/test_meas_info.py @@ -24,8 +24,8 @@ from mne.io.meas_info import (Info, create_info, _merge_info, _force_update_info, RAW_INFO_FIELDS, _bad_chans_comp, _get_valid_units) -from mne.digitization._utils import (_write_dig_points, _read_dig_points, - _make_dig_points,) +from mne._digitization._utils import (_write_dig_points, _read_dig_points, + _make_dig_points,) from mne.io import read_raw_ctf from mne.utils import _TempDir, run_tests_if_main, catch_logging from mne.channels.montage import read_montage, read_dig_montage diff --git a/mne/io/tests/test_raw.py b/mne/io/tests/test_raw.py index 0b8b5795ce7..f5d6504c109 100644 --- a/mne/io/tests/test_raw.py +++ b/mne/io/tests/test_raw.py @@ -20,7 +20,7 @@ from mne.utils import _TempDir, catch_logging, _raw_annot from mne.io.meas_info import _get_valid_units -from mne.digitization import Digitization +from mne._digitization import Digitization def test_orig_units(): diff --git a/mne/tests/test_digitization.py b/mne/tests/test_digitization.py index 6108444240e..7c79d065645 100644 --- a/mne/tests/test_digitization.py +++ b/mne/tests/test_digitization.py @@ -5,8 +5,8 @@ # License: BSD (3-clause) import pytest import numpy as np -from mne.digitization import Digitization -from mne.digitization.base import _format_dig_points +from mne._digitization import Digitization +from mne._digitization.base import _format_dig_points dig_dict_list = [ dict(kind=_, ident=_, r=np.empty((3,)), coord_frame=_) diff --git a/mne/viz/tests/test_3d.py b/mne/viz/tests/test_3d.py index f47a18e15da..b9745d999d1 100644 --- a/mne/viz/tests/test_3d.py +++ b/mne/viz/tests/test_3d.py @@ -19,7 +19,7 @@ setup_volume_source_space, read_forward_solution, VolVectorSourceEstimate, convert_forward_solution) from mne.io import read_raw_ctf, read_raw_bti, read_raw_kit, read_info -from mne.digitization._utils import write_dig +from mne._digitization._utils import write_dig from mne.io.pick import pick_info from mne.io.constants import FIFF from mne.viz import (plot_sparse_source_estimates, plot_source_estimates,