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
[MRG; ENH] Add "add_estimated_fiducials" to DigMontage #9118
Conversation
@larsoner I am not sure how to best follow the unit tests you specified in #9111 (comment) I kind of... pseudocoded it out here, but not familiar w/ all the testing datasets in MNE. Would you be able to provide some more explicit guidance here on what exactly do I load and compare? |
Probably something close to this: https://github.com/mne-tools/mne-python/blob/main/mne/tests/test_coreg.py#L267-L281 You want to load the actual manually-created |
The failing ci is due to the doc strings. I made some suggestions about how this could be fixed, there may well be a better fix. |
mne/channels/montage.py
Outdated
_validate_type(item=fids_mri, types=list, item_name='dig') | ||
|
||
# add those digpoints to montage | ||
self.dig.extend(fids_mri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to insert these at the beginning, I think that's usually where we put fiducials in the dig list.
Co-authored-by: Robert Luke <748691+rob-luke@users.noreply.github.com>
Co-authored-by: Robert Luke <748691+rob-luke@users.noreply.github.com>
Co-authored-by: Robert Luke <748691+rob-luke@users.noreply.github.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Is there a way to link the docstring to an existing tutorial? E.g. If a user isn't understanding why one needs the |
Crossrefs to tutorials are probably most appropriate in a
|
If this CI works, will add the changelog. don't wanna hit the CIs again :p |
Feel free to push, I'll probably go through and clear out the GitHub Actions log soon anyway... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1 for merge once CIs come back happy (someday)
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Thanks @adam2392 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for coming late to the party :(
- :func:`mne.io.anonymize_info` now anonymizes also sex and hand fields when ``keep_his`` is ``False`` (:gh:`9103` by |Rotem Falach|_)` | ||
- Add :func:`mne.channels.DigMontage.add_estimated_fiducials` which will add LPA, RPA and Nasion fiducial points to the ``DigMontage`` object in ``mri`` coordinate frame (:gh:`9118` by `Adam Li`_) | ||
|
||
- :func:`mne.io.anonymize_info` now anonymizes also sex and hand fields when ``keep_his`` is ``False`` (:gh:`9103` by |Rotem Falach|_)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent pb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this in main
, it was my error during the mege...
This takes a montage with the ``mri`` coordinate frame, | ||
corresponding to the FreeSurfer RAS (xyz in the volume) T1w | ||
image of the specific subject. It will call | ||
:func:`mne.coreg.get_mni_fiducials` to estimate LPA, RPA and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like to have stuff from coreg module to be imported outside. coreg should be GUI code only I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed we could move it to source_space.py
, it's where we deal with coordinate frames most of the time anyway
and then use ``montage.get_native_head_t()`` to get the | ||
head <-> MRI transform. | ||
""" | ||
from ..coreg import get_mni_fiducials |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes nested import is required exactly for this I think.
Agreed we could move it to source_space.py, it's where we deal with coordinate frames most of the time anyway
+1
can you do the PR?
|
Reference issue
Closes: #9111
Will enhance: #9087 and
plot_seeg
related tutorials in the future. Necessary ingredients for dataset though:What does this implement/fix?
Add
add_estimated_fiducials
function toDigMontage
.Implements unit test... todo
Additional information
From BIDS convos of mne sprint chat.