|
| 1 | +from stormdb.access import Query |
| 2 | +from stormdb.process import Maxfilter |
| 3 | +from os.path import join |
| 4 | +from os import makedirs |
| 5 | + |
| 6 | +proj_name = 'MINDLAB2018_MEG-SF-Integration-Images' |
| 7 | +mf_out_path = join('/projects', proj_name, 'scratch', 'maxfiltered') |
| 8 | +log_out_path = join('/projects', proj_name, 'scratch', 'maxfiltered', 'logs') |
| 9 | +makedirs(log_out_path, exist_ok=True) |
| 10 | + |
| 11 | +qy = Query(proj_name) |
| 12 | +mf = Maxfilter(proj_name) |
| 13 | + |
| 14 | +# Get all series (regardless of subject) named '*SFtuned*' (note wildcards) |
| 15 | +series = qy.filter_series(description='*SFtuned*') |
| 16 | +# Restrict to specific subjects |
| 17 | +# series = qy.filter_series(description='*SFtuned*', subjects=['0007', '0012']) |
| 18 | +# Restrict to specific modality |
| 19 | +# series = qy.filter_series(description='*mprage*', modalities='MR') |
| 20 | + |
| 21 | +for ses in series: |
| 22 | + # MEG acquistions will be split into 2GB chunks if long |
| 23 | + for fifname in ses['files']: |
| 24 | + in_fname = join(ses['path'], fifname) |
| 25 | + |
| 26 | + outbase = splitext(fifname)[0] |
| 27 | + out_fname = join(mf_out_path, outbase + '_tsss.fif') |
| 28 | + log_fname = join(log_out_path, outbase + '_tsss.log') |
| 29 | + |
| 30 | + # see maxfilter manual for options |
| 31 | + mf.build_cmd(in_fname, out_fname, logfile=log_fname, |
| 32 | + autobad='on', st=True, st_buflen=16.0, st_corr=0.96, |
| 33 | + force=False) |
| 34 | + |
| 35 | +mf.submit(fake=True) # remove "fake" when ready to submit! |
| 36 | + |
| 37 | +# mf.commands contains a list of commands that will be sent to cluster |
0 commit comments