args = parser.parse_args() params = vars(args) json_file = str(params["f"][0]) subj_index = params["n"] print(json_file) # read the pipeline params with open(json_file) as pipeline_file: pipeline_params = json.load(pipeline_file) raw_path = pipeline_params["RAW_PATH"] t1_path = pipeline_params["T1_PATH"] fs_path = pipeline_params["FS_PATH"] raw_subjects = files.get_folders_files(raw_path, wp=False)[0] raw_subjects.sort() raw_subj = raw_subjects[subj_index] raw_subj_dir = op.join(raw_path, raw_subj, "scans", "2_t1_mprage_sag_iso_1mm") t1_subj_dir = op.join(t1_path, raw_subj) files.make_folder(t1_subj_dir) def dcm2nii_func(t1_subj_dir, raw_subj_dir): dcm2nii = "/cubric/software/mricron/dcm2nii" try: t1_file = files.get_files(t1_subj_dir, "co", "nii.gz")[2][0]
parser.add_argument("-n", type=int, help="id list index") args = parser.parse_args() params = vars(args) json_file = params["f"] subj_index = params["n"] # read the pipeline params with open(json_file) as pipeline_file: pipeline_params = json.load(pipeline_file) # paths data_path = pipeline_params["data_path"] fs_path = op.join(data_path, "MRI") subjs = files.get_folders_files(fs_path, wp=False)[0] subjs.sort() subjs = [i for i in subjs if "fsaverage" not in i] subj = subjs[subj_index] meg_subj_path = op.join(data_path, "MEG", subj) beh_subj_path = op.join(data_path, "BEH", subj) verb = False if pipeline_params["downsample_convert_filter"]: raw_ds = files.get_folders_files(meg_subj_path, wp=True)[0] raw_ds = [i for i in raw_ds if ".ds" in i] for ix, raw_path in enumerate(raw_ds): raw = mne.io.read_raw_ctf(raw_path, preload=True, verbose=False)
json_file = sys.argv[2] print(json_file) except: json_file = "pipeline_params.json" print(json_file) # open json file with open(json_file) as pipeline_file: parameters = json.load(pipeline_file) # prepare paths data_path = parameters["path"] subjects_dir = parameters["freesurfer"] # subjects subjs = files.get_folders_files(subjects_dir, wp=False)[0] subjs = [i for i in subjs if "00" in i] subjs.sort() subj = subjs[subj_index] # processing parameters down_freq = parameters["downsample"] chpi = [ "HLC0011", "HLC0012", "HLC0013", "HLC0021", "HLC0022", "HLC0023", "HLC0031", "HLC0032", "HLC0033" ] subj_path = op.join(data_path, "MEG", subj) if parameters["convert_downsample_filter"]: all_ds = files.get_folders_files(subj_path, wp=True)[0]
try: file_index = int(sys.argv[2]) except: print("incorrect file index") sys.exit() # open json file with open(json_file) as pipeline_file: parameters = json.load(pipeline_file) # prepare paths data_path = parameters["path"] subjects_dir = parameters["freesurfer"] subjects = files.get_folders_files(subjects_dir, wp=False)[0] subjects.sort() subjects = [i for i in subjects if "fsaverage" not in i] subject = subjects[subj_index] subject_meg = op.join(data_path, "MEG", subject, parameters["folder"]) raw_paths = files.get_files(subject_meg, "80-", "-raw.fif", wp=True)[2] raw_paths.sort() raw_path = raw_paths[file_index] print(raw_path) print(subject) mne.gui.coregistration(subjects_dir=subjects_dir, subject=subject,
try: file_index = int(sys.argv[1]) except: print("incorrect arguments") sys.exit() output_path = "/cubric/scratch/c1557187/stirring/RESULTS/SVC/data" beh_path = "/cubric/scratch/c1557187/stirring/BEH" beh_files = files.get_files(beh_path, "", "matched.gz")[2] beh_files.sort() epo_path = "/cubric/scratch/c1557187/stirring/MEG" subjects = files.get_folders_files(epo_path, wp=False)[0] subjects.sort() long_files = [ files.get_files(op.join(epo_path, i), "long", "epo.fif")[2][0] for i in subjects ] long_files.sort() engage_files = [ files.get_files(op.join(epo_path, i), "engage", "epo.fif")[2][0] for i in subjects ] engage_files.sort() change_files = [
args = parser.parse_args() params = vars(args) subj_index = params["n"] file_index = params["f"] json_ICA = "ICA_comp.json" json_file = "pipeline_params.json" # read the pipeline params with open(json_file) as pipeline_file: pipeline_params = json.load(pipeline_file) # PATHS data_out = op.join(pipeline_params["output_path"], "data") subjs = files.get_folders_files(data_out, wp=False)[0] subjs.sort() subj = subjs[subj_index] subj_path = op.join(data_out, subj) ica_files = files.get_files(subj_path, "", "-ica.fif")[2] ica_files.sort() raw_files = files.get_files(subj_path, "", "-raw.fif", wp=True)[2] raw_files.sort() raw_file = raw_files[file_index] ica_file = ica_files[file_index]
try: json_file = sys.argv[2] print(json_file) except: json_file = "pipeline.json" print(json_file) # open json file with open(json_file) as pipeline_file: parameters = json.load(pipeline_file) # prepare paths data_path = parameters["path"] subjects_dir = parameters["freesurfer"] subjects = files.get_folders_files(subjects_dir, wp=False)[0] subjects.sort() subjects = [i for i in subjects if "fsaverage" not in i] subject = subjects[subj_index] print("subject:", subject) subject_raw = op.join(data_path, "MEG", subject) subject_meg = op.join(data_path, "MEG", subject, parameters["folder"]) files.make_folder(subject_meg) subject_beh = {data_path, "BEH", subject} if parameters["step_1"]: