Skip to content

Commit

Permalink
Solving issue #13122: Aiming to achieve better sensitivity of head m…
Browse files Browse the repository at this point in the history
…ovement detection for chpi extraction (#13123)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
shresth-keshari and pre-commit-ci[bot] authored Feb 26, 2025
1 parent 11df2fa commit c0f1665
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/changes/devel/13123.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed CTF cHPI coil location detection in :func:`mne.chpi.extract_chpi_locs_ctf` by :newcontrib:`Shresth Keshari`.
1 change: 1 addition & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
.. _Senwen Deng: https://snwn.de
.. _Seyed Yahya Shirazi: https://neuromechanist.github.io
.. _Sheraz Khan: https://github.com/SherazKhan
.. _Shresth Keshari: https://github.com/shresth-keshari
.. _Shristi Baral: https://github.com/shristibaral
.. _Silvia Cotroneo: https://github.com/sfc-neuro
.. _Simeon Wong: https://github.com/dtxe
Expand Down
2 changes: 1 addition & 1 deletion mne/chpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def extract_chpi_locs_ctf(raw, verbose=None):

# find indices where chpi locations change
indices = [0]
indices.extend(np.where(np.all(np.diff(chpi_data, axis=1), axis=0))[0] + 1)
indices.extend(np.where(np.any(np.diff(chpi_data, axis=1), axis=0))[0] + 1)
# data in channels are in ctf device coordinates (cm)
rrs = chpi_data[:, indices].T.reshape(len(indices), 3, 3) # m
# map to mne device coords
Expand Down

0 comments on commit c0f1665

Please sign in to comment.