MAINT: Refactor digitation for KIT, artemis123, bti#6368
MAINT: Refactor digitation for KIT, artemis123, bti#6368massich merged 22 commits intomne-tools:masterfrom
Conversation
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
|
looking good so far 👍 |
Codecov Report
@@ Coverage Diff @@
## master #6368 +/- ##
=========================================
Coverage ? 89.32%
=========================================
Files ? 408
Lines ? 74300
Branches ? 12292
=========================================
Hits ? 66371
Misses ? 5072
Partials ? 2857 |
|
Let me know when CIs are green and I should look |
|
@larsoner I'm AFK but Travis is green |
|
But coverage went off. I'll check |
|
Oh yes, I did not update the doc so it searches mne.io.DigPoint rather than mne.digitization.DigPoint |
|
Can I get feedback for this PR? cc: @mne-tools/contributors |
mne/digitization/_utils.py
Outdated
|
|
||
|
|
||
| def _read_dig_points(fname, comments='%', unit='auto'): | ||
| """Read digitizer data from a text file. |
There was a problem hiding this comment.
apparently you can read more than from a .txt file
mne/digitization/_utils.py
Outdated
|
|
||
| Returns | ||
| ------- | ||
| dig : Digitization |
There was a problem hiding this comment.
maybe you can already put a doc template for a parameter of type dig?
mne/digitization/_utils.py
Outdated
|
|
||
| Parameters | ||
| ---------- | ||
| mrk : None | str | array_like, shape = (5, 3) |
There was a problem hiding this comment.
can you remove the = after shape in this docstring?
|
|
||
| Returns | ||
| ------- | ||
| dig_points : list |
There was a problem hiding this comment.
what is not standard? in this return?
| dig_points : list | ||
| List of digitizer points for info['dig']. | ||
| dev_head_t : dict | ||
| A dictionary describe the device-head transformation. |
There was a problem hiding this comment.
do we have a template docstring for this?
mne/digitization/_utils.py
Outdated
| mrk = read_mrk(mrk) | ||
|
|
||
| # hsp = apply_trans(als_ras_trans, hsp) | ||
| # elp = apply_trans(als_ras_trans, elp) |
There was a problem hiding this comment.
it was there before? is this expected?
| # From bti | ||
| def _make_bti_dig_points(nasion, lpa, rpa, hpi, extra, | ||
| convert=False, use_hpi=False, | ||
| bti_dev_t=False, dev_ctf_t=False): |
There was a problem hiding this comment.
I don't think is necessary this function should die in the next PR.
| ident : int | ||
| Identifier. | ||
| r : ndarray, shape (3,) | ||
| Position. |
|
I did not touch the docstrings much. (Just a find and replace of |
|
ok to merge then when you're happy and CIs are green. I agree to do one thing at a time |
|
I probably can't really look until Friday so don't wait for me. |
GuillaumeFavelier
left a comment
There was a problem hiding this comment.
I have only small suggestions, thank you for your work @massich
| from ..transforms import Transform | ||
| from ..transforms import combine_transforms | ||
| from ..transforms import invert_transform | ||
| from ..transforms import _to_const |
There was a problem hiding this comment.
You prefer one import at a time?
There was a problem hiding this comment.
we don't have a strict policy that I'm aware of, and its easier like this when I'm moving code around. I'll do a clean up on the last PR.
| elp = elp[3:] | ||
|
|
||
| dig_points = _make_dig_points(nasion, lpa, rpa, elp, hsp) | ||
| dev_head_t = Transform('meg', 'head', trans) |
There was a problem hiding this comment.
To be consistent with previous call:
dev_head_t = Transform(fro='meg', to='head', trans=trans)
There was a problem hiding this comment.
agreed. I'll at them on the next PR.
| 'meg', 'ctf_head') | ||
| dev_head_t = combine_transforms(t, ctf_head_t, 'meg', 'head') | ||
| else: | ||
| dev_head_t = Transform('meg', 'head', trans=None) |
There was a problem hiding this comment.
dev_head_t = Transform(fro='meg', to='head', trans=None)
Co-authored-by: Teon Brooks <teon.brooks@gmail.com>
This PR: