Skip to content

Conversation

@pmolfese
Copy link
Contributor

@pmolfese pmolfese commented Mar 24, 2025

Fixes #13166.
Closes #13185.

What does this implement/fix?

Adds code to bem.py/make_watershed_bem with a gcatlas=True for file subject_dir + "/mri/transforms/talairach_with_skull.lta and if the file doesn't exist (due to Freesurfer 8 not automatically generating it), run mri_em_register. Then proceed to run the regular mri_watershed command.

Additional information

  1. I debated doing a more comprehensive check of files before starting, but settled on a nested check with new cmd (em_reg_cmd) and execution.

  2. There isn't currently a test for mri_watershed in test_bem.py and I don't currently have the time to add a comprehensive one.

@pmolfese pmolfese changed the title Mod make_watershed_bem to handle missing talairach_with_skull.lta courtesy Freesurfer 8 FIX make_watershed_bem to handle missing talairach_with_skull.lta courtesy Freesurfer 8 Mar 24, 2025
@drammock
Copy link
Member

linux pip-pre error can be ignored (should be fixed by #13178), but the doc build error looks related:

/home/circleci/project/doc/<rst_prolog>:33: WARNING: py:func reference target not found: make_watershed_bem [ref.func]

Copy link
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

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

looks reasonable to me, though I'm far from an expert with freesurfer.

Co-authored-by: Daniel McCloy <dan@mccloy.info>
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.

Just a tiny DRY tweak otherwise LGTM, marking for merge-when-green, thanks @pmolfese !

I might also sneak in a tiny fix for #13185 as well just to make sure it comes back green 🙂

@larsoner larsoner enabled auto-merge (squash) April 3, 2025 17:01
@larsoner larsoner merged commit 618932d into mne-tools:main Apr 3, 2025
30 checks passed
larsoner added a commit to larsoner/mne-python that referenced this pull request Apr 4, 2025
* upstream/main: (149 commits)
  FIX make_watershed_bem to handle missing talairach_with_skull.lta courtesy Freesurfer 8 (mne-tools#13172)
  ENH: Add upsampling for MEG helmet surface (mne-tools#13179)
  MAINT: Update code credit (mne-tools#13180)
  BUG: Fix bug with least-squares sphere fit (mne-tools#13178)
  fix EDF export (mne-tools#13174)
  fix typo (mne-tools#13171)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13164)
  Fix dev installation guide (mne-tools#13163)
  expose 'mode' for plotting dipole on brain (mne-tools#13162)
  turn dipole attrs into properties (mne-tools#13153)
  remove misformatted (and unused) crossref anchor (mne-tools#13155)
  doc: point to read_dipole (mne-tools#13149)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13152)
  BUG: Fix bug with not short-circuiting n_jobs=1 (mne-tools#13147)
  FIX: Missing coordinates.xml in MFF file (mne-tools#13148)
  FIX: Gracefully handle bad XML files in EGI reader (mne-tools#13145)
  Fixes for Latest IPython (9.0.1) (mne-tools#13146)
  Fix intersphinx (mne-tools#13143)
  BUG: Fix bug with parallel doc build (mne-tools#13140)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13141)
  ...
larsoner added a commit to SYXiao2002/mne-python that referenced this pull request Apr 18, 2025
* upstream/main: (40 commits)
  fix typo (missing space) that messed up rst rendering (mne-tools#13217)
  MAINT: Restore VTK dev (mne-tools#13214)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13212)
  BUG: Fix bug with example (mne-tools#13210)
  MAINT: Fix pip-pre with PyVista (mne-tools#13207)
  Move FCBG to former partners (mne-tools#13205)
  ENH: Update related software list (mne-tools#13202)
  fix sfreq estimation for snirf files (mne-tools#13184)
  ENH: Use data-based padding instead of "odd" padding when filtering in raw.plot (mne-tools#13183)
  FIX: Bumps (mne-tools#13198)
  DOC: fix typo in examples/io/read_impedances.py (mne-tools#13197)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13173)
  FIX make_watershed_bem to handle missing talairach_with_skull.lta courtesy Freesurfer 8 (mne-tools#13172)
  ENH: Add upsampling for MEG helmet surface (mne-tools#13179)
  MAINT: Update code credit (mne-tools#13180)
  BUG: Fix bug with least-squares sphere fit (mne-tools#13178)
  fix EDF export (mne-tools#13174)
  fix typo (mne-tools#13171)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13164)
  Fix dev installation guide (mne-tools#13163)
  ...
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.

pip-pre windows still failing fine_cal test bem.make_watershed_bem with gcatlas fails on default Freesurfer 8 processing

3 participants