outf = '/data/intradb/home/hileman/intradb_python_pipeline/log/%s_%s_%s.csv' % (idb.project, pipeline, timestamp) print outf if __name__ == "__main__": sessions = idb.getSessions(idb.project) session_labels = list() for s in sessions: #if 'Stroop' not in s.get('label'): # continue session_labels.append(s.get('label')) session_labels = sorted(session_labels, key=lambda s: s.split('_')[0]) for s in session_labels: idb.session_label = s sub = idb.getSessionSubject() # fails sometimes, so check that this found something #if not sub: # sub = s.split('_')[0] print sub command = "python resources.py -u %s -p %s -H %s -s %s -S %s -P %s -f %s -i %s -I" % \ (idb.username, idb.password, idb.url, sub, s, idb.project, outf, pipeline) print command p = envoy.run(command) if p.std_err: print p.std_err print "Here's your output:", outf
for qc_ass in qc_assessments: idb.deleteSessionAssessor(qc_ass['label']) if __name__ == "__main__": sessions = opts.sessions.split(',') print "=" * 82 print "Launching %s pipeline for %s sessions on %s" % \ (opts.pipeline, sessions.__len__(), idb.url) print "Build directory: " + builddir print "Archive directory: " + archivedir print "=" * 82 for s in sessions: idb.session_label = s idb.subject_label = idb.getSessionSubject() # TODO - fails sometimes, so check that this found something if not idb.subject_label: idb.subject_label = s.split('_')[0] # Not general, but often works print '\n** Subject: ' + idb.subject_label print '** Session: ' + s + '\n' if opts.pipeline == 'validation': launchValidation() elif opts.pipeline == 'facemask': launchFacemask() elif opts.pipeline == 'dcm2nii': launchDicomToNifti() elif opts.pipeline == 'level2qc': # Set default delay for level2qc if not opts.delay: