Skip to content

Conversation

@bloyl
Copy link
Contributor

@bloyl bloyl commented Jan 21, 2021

@larsoner

The utility of _fit_coil_order_dev_head_trans allowed for computing the device head transforms when the ordering of the HPIs in dig didn't match the ordering in the device cords.

At some point the cost function was modified to strongly favor small rotations. While often what you want, it isn't always what you want. for instance when running a phantom to check that the HPIs are still working after a PM visit.

This PR just makes this penalty optional.

Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we expose this publicly somehow / somewhere, too? Ideally things wouldn't break for you if I later went through and modified this function (e.g., if I had pushed such a variable name in the future). If we made some public interface we could avoid the coverage drop / lack of testing. A simple test comparing that, for reasonable data, the two match is probably good enough.

mne/chpi.py Outdated


def _fit_coil_order_dev_head_trans(dev_pnts, head_pnts):
def _fit_coil_order_dev_head_trans(dev_pnts, head_pnts, pen_large_rots=True):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just bias=True is clear enough?

Base automatically changed from master to main January 23, 2021 18:27
@bloyl
Copy link
Contributor Author

bloyl commented Feb 28, 2021

bias is fine.

I don't have a strong opinion on making this public. In reality its a utility method that probably belongs in transforms not in chpi.

* upstream/main:
  MAINT: Skip matplotlib pre for now (mne-tools#8973)
  FIX: Brain lights (mne-tools#8972)
  MNT: Migrate VTK Widgets (mne-tools#8862)
  Fix (mne-tools#8971)
  Fix indexing dipoles read from a bdip file (mne-tools#8963)
@larsoner larsoner merged commit 250eabf into mne-tools:main Mar 2, 2021
@larsoner
Copy link
Member

larsoner commented Mar 2, 2021

Thanks @bloyl !

larsoner added a commit to larsoner/mne-python that referenced this pull request Mar 2, 2021
* upstream/main:
  MAINT: Revert conda azure change (mne-tools#8978)
  make large rotation penalty optional in chpi function (mne-tools#8770)
  Fix: Wrong channel-adjacency-matrix for Neuromag122 (mne-tools#8891)
  [MRG] Add optional different ways of averaging EpochsTFR (mne-tools#8879)
  DOC, STY: fix dataframe scrolling (mne-tools#8977)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants