Skip to content

ENH: support auto and fsaverage for add_trans in report #13232

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sappelhoff
Copy link
Member

@larsoner larsoner requested a review from alexrockhill as a code owner April 28, 2025 18:33
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.

@drammock this should be good to go... any further commits will just be to fix any faulty logic if CIs fail

Comment on lines +234 to +252
if subject is None:
if "SUBJECT" in os.environ:
subject = os.environ["SUBJECT"]
else:
raise ValueError(
"subject is None and SUBJECT environment variable not set, cannot "
"use trans='auto'"
)
glob_str = str(subjects_dir / subject / "*-trans.fif")
trans_fnames = glob.glob(glob_str)
if len(trans_fnames) < 1:
raise RuntimeError(
f"Could not find the transformation for {subject} in: {glob_str}"
)
elif len(trans_fnames) > 1:
raise RuntimeError(
f"Found multiple transformations for {subject} in: {glob_str}"
)
trans = Path(trans_fnames[0])
Copy link
Member

Choose a reason for hiding this comment

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

These lines are just indentation plus improved error message (giving the user the glob string to help them understand why the trans wasn't found)

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.

Allow fsaverage for subject in mne.Report.add_trans
2 participants