-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Digitization progress #6461
Comments
Thanks for the overview @massich! I think there is also #6412 (add a |
@GuillaumeFavelier right! |
@massich updated top description with my suggested order / description based on extrapolating what I discussed with @agramfort |
just to make sure that we are all on the same page. This should pass without warning error nothing: def test_montage():
raw_montage = read_raw_*(fname, montage=my_montage)
raw_none = read_raw_*(fname, montage=None)
raw_none.set_montage(montage)
assert object_diff(raw_none.info['chs'], raw_montage.info['chs'])
assert object_diff(raw_none.info['dig'], raw_montage.info['dig']) |
yes exactly
|
Yes in this PR. Eventually in this release cycle we will deprecade the |
Sorry, I meant to say that yes, that should be the behavior in #6462. In the PR after that, |
mne-python/mne/channels/channels.py Line 446 in 2f9873e
In other words, |
now that montage is deprecated, the idea is that |
Yeah I think so. |
question is should we still call it set_montage or we introduce a new
method set_digitization?
just thinking out loud...
|
|
There are at least two ways of getting the digitization information from a fif file: mne-python/mne/io/meas_info.py Line 891 in 897c3b2
mne-python/mne/channels/montage.py Line 637 in 897c3b2
it is true that one populates (The later calls the former) |
not really as the anything is done after _read_dig_fif(fid, tree) is
just to make a DigMontage from a dig (get numpy arrays and a few attributes)
… |
Regarding the ~/code/mne-python read_dig_montage_polhemus
(mne) ❯ git grep -i 'FIFFV_MNE_COORD_DIGITIZER'
mne/io/constants.py:FIFF.FIFFV_MNE_COORD_DIGITIZER = FIFF.FIFFV_COORD_ISOTRAK # Original (Polhemus) digitizer coordinates
mne/io/tests/test_constants.py: FIFFV_MNE_COORD_DIGITIZER='FIFFV_COORD_ISOTRAK', |
yes then we need to change the read_dig_xxx so they don't use unknown but
the proper
source of the data. We would need to add a constant for captrack though
|
explaining some context behind the KIT digitization process at NYU based on a discussion with @massich. so for the KIT system, the use of the labels elp and hpi had come from the naming used in the old mne-c manual. HPI ELP I think that ideally there should be three files as opposed to two files: one for the HPI points (5 points), one for those points in digitizer space (5 points), and one file for the fiducials (3 points). I don't think including the fiducials in the points file is a good idea anymore because this requires an arbitrary assignment of points to references. From my discussion with @massich, it is true that someone could place the points in any manner they sought fit but there is no way for the software to intelligently know this. File Format Naming After thinking about this, I think that HPI should remain being hope this provides some context and recommendations. |
I think #6764 is enough. I'm closing this one |
This issue is to keep track of the remaining Digitization PRs. It reflects a conversation with @larsoner.
TODO (each item will be a separate PR):
Add move all
montage
use to Raw and Epochs readers that havemontage
argument to call only the following at the end of their__init__
, not used anywhere else (Add montage parameter to BaseRaw #6462):Deprecate
montage
argument in all readers that supportmontage
arguments ([MRG] Deprecate montage param from all EEG raw readers #6534)Replicate montage and digmontage usecases withThis no longer applies. We keptDigitization
DigMontage
, removeMontage
and makedigitization
private.DigMontage
to useDigitization
+ch_names
as representation (+ deprecate things that we no longer want to support) (MNT: Change DigMontage representation to use Digitization #6639)digitization
module private_digitization
(Make mne/digitization private mne/_digitization #6700)DigMontage.save
(savesdig
but notch_names
)DigMontage()
without parmeters.DigMontage
tests. All that we did not change in MNT: Change DigMontage representation to use Digitization #6639 because we only wanted to touch code logic not test logic.set_montage
takes onlyDigMontage
notMontage
mne/_digitization
. We have all_make_dig_{kit, artemist, bti}
that overlap withDigMontage
.read_dig_montage
in favor ofread_dig_montage_FOO
ormake_dig_montage(np.arrays..)
. No transforms allowed.DigMontage.dev_head_t
in favor of:DigMontage.dig
: one inFIFFV_COORD_HEAD
and the other inFIFFV_COORD_MEG
.When you want
dev_head_t
, callDigMontage.get_dev_head_t()
and it will compute it from these directly.def compute_dev_head_t(dig: Digitization) -> Transform:
elp
,hpi
in favor of the new names (hpi
,hpi_dev
) in the internal calls. (I'm not sure this will be needed. We'll see)DigMontage.transform_to_head()
(not fully clear but it will get more clear when addressing the others). Things that could require:def get_fiducials(dig: Digitization) -> Fiducials:
(Fiducials
is aBunch
withnasion
,lpa
,rpa
or similar, named tuple whatever.)remove fit_match_points outside of coreg.
move
read_dig_XXXX
tomne/io/
AddFix theplot()
toDigitization
class WIP: Add plot method to digitization #6412. 3D plot with each dig point, maybe symbol based on coordinate frame (sphere=head, cube=meg, ... ?) and color based on type (eeg, extra, hpi, we have colors for these indefaults.py
orplot_alignment
somewhere)DigMontage
-Montage
mess we had in the existing plot withpoint_names
and custom transforms. ([RFC] Are we aiming to be able to write plot_montage like this? #6649, maybe different PR)Make a none smoke test for applied transforms Reveal missing test massich/mne-python#31 (I've close it by error, it still applies)
Log of past PRs:
Cross-reference issues:
Here is a summary of the readers with respect to how they are tested. Main focus: does the reader go through
_test_raw_reader
? has the reader been tested withdigitization
orNone
? Does the reader have digitization or amontage
?other notes:
The text was updated successfully, but these errors were encountered: