Skip to content

Commit

Permalink
Update run.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-luke authored Jun 19, 2021
1 parent e737c55 commit ba485ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def run(command, env={}):
if args.task_label:
tasks = args.task_label
else:
all_snirfs = glob("/bids_dataset/**/*_nirs.snirf", recursive=True)
all_snirfs = glob(f"{args.bids_dir}/**/*_nirs.snirf", recursive=True)
for a in all_snirfs:
s = a.split("_task-")[1]
s = s.split("_nirs.snirf")[0]
Expand Down Expand Up @@ -198,11 +198,11 @@ def summarise_odpsd(raw, report):
########################################

print(" ")
Path("/bids_dataset/derivatives/fnirs-apps-quality-reports/").\
Path(f"{args.bids_dir}/derivatives/fnirs-apps-quality-reports/").\
mkdir(parents=True, exist_ok=True)
for id in ids:
report = mne.Report(verbose=True, raw_psd=True)
report.parse_folder(f"/bids_dataset/sub-{id}", render_bem=False)
report.parse_folder(f"{args.bids_dir}/sub-{id}", render_bem=False)
for idx, fname in enumerate(report.fnames):
if mne.report._endswith(fname, 'nirs'):
raw = mne.io.read_raw_snirf(fname)
Expand All @@ -214,7 +214,7 @@ def summarise_odpsd(raw, report):
raw, report = summarise_sci(raw, report, threshold=args.sci_threshold)
raw, report = summarise_montage(raw, report)

report.save("/bids_dataset/derivatives/fnirs-apps-quality-reports/"
report.save(f"{args.bids_dir}/derivatives/fnirs-apps-quality-reports/"
f"report_basic_{id}.html",
overwrite=True, open_browser=False)

0 comments on commit ba485ed

Please sign in to comment.