Skip to content
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

Fixes #206

Merged
merged 3 commits into from
Jul 3, 2023
Merged

Fixes #206

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osl/maxfilter/maxfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def run_multistage_maxfilter(infif, outbase, args):
os.remove(outfif)

# Fixed Args
stage3_args = {'autobad': None}
stage3_args = {'autobad': None, 'force': True}
# User args
for key in ['maxpath', 'scanner', 'ctc', 'cal',
'dryrun', 'overwrite', 'trans', 'outdir']:
Expand Down
14 changes: 6 additions & 8 deletions osl/preprocessing/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,12 @@ def write_dataset(dataset, outbase, run_id, overwrite=False):
The saved fif file name
"""

if "preproc_raw" in run_id:
fif_outname = outbase.format(
run_id=run_id.replace("_preproc_raw", ""), ftype="preproc_raw", fext="fif"
)
else:
fif_outname = outbase.format(
run_id=run_id.replace("_raw", ""), ftype="preproc_raw", fext="fif"
)
# Strip "_preproc_raw" or "_raw" from the run id
for string in ["_preproc_raw", "_raw"]:
if string in run_id:
run_id = run_id.replace(string, "")

fif_outname = outbase.format(run_id=run_id, ftype="preproc_raw", fext="fif")
if Path(fif_outname).exists() and not overwrite:
raise ValueError(
"{} already exists. Please delete or do use overwrite=True.".format(fif_outname)
Expand Down
2 changes: 1 addition & 1 deletion osl/preprocessing/osl_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def detect_badchannels(raw, picks, ref_meg="auto", significance_level=0.05):

bdinds = sails.utils.detect_artefacts(
raw.get_data(picks=chinds),
0,
axis=0,
reject_mode="dim",
ret_mode="bad_inds",
gesd_args=gesd_args,
Expand Down
12 changes: 2 additions & 10 deletions osl/source_recon/rhino/polhemus.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from mne.io import read_info
from mne.io.constants import FIFF

import os.path as op
import sys
from osl import utils, source_recon
from osl.source_recon.rhino.coreg import get_coreg_filenames

def extract_polhemus_from_info(
Expand Down Expand Up @@ -178,13 +176,7 @@ def delete_headshape_points(recon_dir=None, subject=None, polhemus_headshape_fil
def scatter_headshapes(ax, x, y, z):
# Polhemus-derived headshape points
color, scale, alpha, marker = "red", 8, 0.7, "o"
ax.scatter(x,y,z,
color=color,
marker=marker,
s=scale,
alpha=alpha,
picker=5,
)
ax.scatter(x, y, z, color=color, marker=marker, s=scale, alpha=alpha, picker=5)
plt.draw()

x=list(polhemus_headshape_polhemus[0,:])
Expand Down Expand Up @@ -223,4 +215,4 @@ def on_press(event):
fig.canvas.mpl_connect('pick_event', on_click)
fig.canvas.mpl_connect('key_press_event', on_press)

plt.show()
plt.show()