diff --git a/corr_two_1D.py b/corr_two_1D.py index 1a5f20d..d93e385 100755 --- a/corr_two_1D.py +++ b/corr_two_1D.py @@ -7,40 +7,78 @@ oned_one_file = str(sys.argv[1]) oned_two_file = str(sys.argv[2]) +cols = None try: - col = str(sys.argv[3]) + cols = [str(sys.argv[3])] except IndexError: - col = None + cols = None -with open(oned_one_file, 'r') as f: - lines = f.readlines() +if "nuisance_regressors.1D" in oned_one_file: + reg_one_df = pd.read_csv(oned_one_file, delimiter="\t", header=2) + reg_two_df = pd.read_csv(oned_two_file, delimiter="\t", header=2) -line_idx = 0 -delimiter = ',' -for line in lines: - if '#' in line: - line_idx += 1 - else: - if ',' in line: - delimiter = ',' - elif '\t' in line: - delimiter = '\t' - break + if not cols: + cols = reg_one_df.columns + + corrs = ["{0}: {1}\n".format(x, scipy.stats.pearsonr(reg_one_df[x].values, reg_two_df[x].values)[0]) for x in cols] + +elif "roi_stats.csv" in oned_one_file: + reg_one_df = pd.read_csv(oned_one_file, header=1) + reg_two_df = pd.read_csv(oned_two_file) + + if not cols: + cols = reg_one_df.columns -if '.par' in oned_one_file: - delimiter = ' ' + corrs = ["{0}: {1}\n".format(x, scipy.stats.pearsonr(reg_one_df[x].values, reg_two_df[x].values)[0]) for x in cols] -oned_one = pd.read_csv(oned_one_file, delimiter=delimiter, header=line_idx-1).dropna(axis=1) -oned_two = pd.read_csv(oned_two_file, delimiter=delimiter, header=line_idx-1).dropna(axis=1) +elif "spatial_map_timeseries.txt" in oned_one_file or ".par" in oned_one_file: + reg_one_df = pd.read_csv(oned_one_file, delimiter=" ", header=None) + reg_two_df = pd.read_csv(oned_two_file, delimiter=" ", header=None) -print(oned_one) + if not cols: + cols = reg_one_df.columns + + corrs = ["{0}: {1}\n".format(x, scipy.stats.pearsonr(reg_one_df[x].values, reg_two_df[x].values)[0]) for x in cols] -if col: - cols = [col] else: - cols = oned_one.columns -corrs = np.asarray([scipy.stats.pearsonr(oned_one[x], oned_two[x])[0] for x in cols]) + with open(oned_one_file, 'r') as f: + lines = f.readlines() + + line_idx = 0 + delimiter = ',' + for line in lines: + if '#' in line or "Mean_" in line: + line_idx += 1 + else: + if ',' in line: + delimiter = ',' + elif '\t' in line: + delimiter = '\t' + else: + delimiter = ' ' + break + + if '.par' in oned_one_file: + delimiter = ' ' + + header_line = line_idx-1 + if header_line < 0: + header_line = None + + oned_one = pd.read_csv(oned_one_file, delimiter=delimiter, header=header_line).dropna(axis=1) + oned_two = pd.read_csv(oned_two_file, delimiter=delimiter, header=header_line).dropna(axis=1) + + if cols: + if '#' in cols: + cols = [cols.replace('#','')] + else: + cols = [x.replace('#','') for x in oned_one.columns if isinstance(x, str)] + + if not cols: + cols = range(0,oned_one.shape[1]) + + corrs = np.asarray([f"{val}: {scipy.stats.pearsonr(oned_one.values.T[x], oned_two.values.T[x])[0]}" for x, val in enumerate(cols)]) for corr in corrs: print(corr) diff --git a/corr_two_ts.py b/corr_two_ts.py old mode 100755 new mode 100644 diff --git a/cpac_correlations.py b/cpac_correlations.py new file mode 100644 index 0000000..2818642 --- /dev/null +++ b/cpac_correlations.py @@ -0,0 +1,1009 @@ +#!/usr/bin/env python + +from typing import Optional, NamedTuple, Tuple, Union + +import os +import glob +import numpy as np +import scipy +from scipy import stats +import pandas as pd + +from multiprocessing import Pool +import itertools + +Axis = Union[int, Tuple[int, ...]] + +class CorrValue(NamedTuple): + concor: np.ndarray + pearson: np.ndarray + + +def read_yml_file(yml_filepath): + import yaml + with open(yml_filepath,"r") as f: + yml_dict = yaml.safe_load(f) + + return yml_dict + + +def write_yml_file(yml_dict, out_filepath): + import yaml + with open(out_filepath, "wt") as f: + yaml.safe_dump(yml_dict, f) + + +def read_txt_file(txt_file): + with open(txt_file,"r") as f: + strings = f.read().splitlines() + return strings + + +def write_txt_file(text_lines, out_filepath): + with open(out_filepath, "wt") as f: + for line in text_lines: + f.write("{0}\n".format(line)) + + +def read_pickle(pickle_file): + import pickle + with open(pickle_file, "rb") as f: + dct = pickle.load(f) + return dct + + +def write_pickle(dct, out_filepath): + import pickle + with open(out_filepath, "wb") as f: + pickle.dump(dct, f, protocol=pickle.HIGHEST_PROTOCOL) + + +def gather_local_filepaths(output_folder_path): + import os + filepaths = [] + + print("Gathering file paths from {0}\n".format(output_folder_path)) + for root, dirs, files in os.walk(output_folder_path): + # loops through every file in the directory + for filename in files: + # checks if the file is a nifti (.nii.gz) + if '.nii' in filename or '.csv' in filename or '.txt' in filename \ + or '.1D' in filename or '.tsv' in filename: + filepaths.append(os.path.join(root, filename)) + + if len(filepaths) == 0: + err = "\n\n[!] No filepaths were found given the output folder!\n\n" + raise Exception(err) + + return filepaths + + +def pull_NIFTI_file_list_from_s3(s3_directory, s3_creds): + + import os + try: + from indi_aws import fetch_creds + except: + err = "\n\n[!] You need the INDI AWS package installed in order to " \ + "pull from an S3 bucket. Try 'pip install indi_aws'\n\n" + raise Exception(err) + + s3_list = [] + + s3_path = s3_directory.replace("s3://","") + bucket_name = s3_path.split("/")[0] + bucket_prefix = s3_path.split(bucket_name + "/")[1] + + bucket = fetch_creds.return_bucket(s3_creds, bucket_name) + + # Build S3-subjects to download + # maintain the "s3://" prefix!! + print("Gathering file paths from {0}\n".format(s3_directory)) + for bk in bucket.objects.filter(Prefix=bucket_prefix): + if ".nii" in str(bk.key): + s3_list.append(os.path.join("s3://", bucket_name, str(bk.key))) + + if len(s3_list) == 0: + err = "\n\n[!] No filepaths were found given the S3 path provided!" \ + "\n\n" + raise Exception(err) + + return s3_list + + +def download_from_s3(s3_path, local_path, s3_creds): + + import os + + try: + from indi_aws import fetch_creds, aws_utils + except: + err = "\n\n[!] You need the INDI AWS package installed in order to " \ + "pull from an S3 bucket. Try 'pip install indi_aws'\n\n" + raise Exception(err) + + s3_path = s3_path.replace("s3://","") + bucket_name = s3_path.split("/")[0] + bucket_prefix = s3_path.split(bucket_name + "/")[1] + + filename = s3_path.split("/")[-1] + local_file = os.path.join(local_path, filename) + + if not os.path.exists(local_file): + bucket = fetch_creds.return_bucket(s3_creds, bucket_name) + aws_utils.s3_download(bucket, ([bucket_prefix], [local_file])) + + return local_file + + +def parse_csv_data(csv_lines): + parsed_lines = [] + for line in csv_lines: + if '#' not in line: + new_row = [float(x.rstrip('\n')) for x in line.split('\t') if x != ''] + parsed_lines.append(new_row) + csv_np_data = np.asarray(parsed_lines) + + return csv_np_data + + +def batch_correlate( + x: np.ndarray, y: np.ndarray, axis: Optional[Axis] = None +) -> CorrValue: + """ + Compute a batch of concordance and Pearson correlation coefficients between + x and y along an axis (or axes). + + References: + https://en.wikipedia.org/wiki/Concordance_correlation_coefficient + """ + # Summary stats for x + x_mean = np.mean(x, axis=axis) + x_var = np.var(x, axis=axis) + x_std = np.sqrt(x_var) + # NOTE: Not trying to fix NaNs + x_norm = (x - x_mean) / x_std + + # Summary stats for y + y_mean = np.mean(y, axis=axis) + y_var = np.var(y, axis=axis) + y_std = np.sqrt(y_var) + y_norm = (y - y_mean) / y_std + + # Correlation coefficients + pearson = np.mean(x_norm * y_norm, axis=axis) + concor = 2 * pearson * x_std * y_std / (x_var + y_var + (x_mean - y_mean) ** 2) + + # Squeeze reduced singleton dimensions + if axis is not None: + concor = np.squeeze(concor, axis=axis) + pearson = np.squeeze(pearson, axis=axis) + return CorrValue(concor, pearson) + + +def correlate_text_based(txt1, txt2): + # TODO: why do we drop columns containing na? + oned_one = pd.read_csv(txt1, delimiter=None, comment="#").dropna(axis=1).values + oned_two = pd.read_csv(txt2, delimiter=None, comment="#").dropna(axis=1).values + + concor, pearson = batch_correlate(oned_one, oned_two, axis=0) + concor = np.nanmean(concor) + pearson = np.nanmean(pearson) + return concor, pearson + + +def create_unique_file_dict(filepaths, output_folder_path, replacements=None): + + # filepaths: + # list of output filepaths from a CPAC output directory + # output_folder_path: + # the CPAC output directory the filepaths are from + # replacements: + # (optional) a list of strings to be removed from the filepaths should + # they occur + + # output + # files_dict + # a dictionary of dictionaries, format: + # files_dict["centrality"] = + # {("centrality", midpath, nums): , ..} + + files_dict = {} + + for filepath in filepaths: + + if "_stack" in filepath: + continue + + if ("itk" in filepath) or ("xfm" in filepath) or ("montage" in filepath): + continue + path_changes = [] + real_filepath = filepath + if replacements: + for word_couple in replacements: + if "," not in word_couple: + err = "\n\n[!] In the replacements text file, the old " \ + "substring and its replacement must be separated " \ + "by a comma.\n\n" + raise Exception(err) + word = word_couple.split(",")[0] + new = word_couple.split(",")[1] + if word in filepath: + path_changes.append("old: {0}".format(filepath)) + filepath = filepath.replace(word, new) + path_changes.append("new: {0}".format(filepath)) + if path_changes: + import os + with open(os.path.join(os.getcwd(), "path_changes.txt"), "wt") as f: + for path in path_changes: + f.write(path) + f.write("\n") + + filename = filepath.split("/")[-1] + + # name of the directory the file is in + folder = filepath.split("/")[-2] + + midpath = filepath.replace(output_folder_path, "") + midpath = midpath.replace(filename, "") + + pre180 = False + if pre180: + # name of the output type/derivative + try: + category = midpath.split("/")[2] + except IndexError as e: + continue + + if "eigenvector" in filepath: + category = category + ": eigenvector" + if "degree" in filepath: + category = category + ": degree" + if "lfcd" in filepath: + category = category + ": lfcd" + else: + tags = [] + category = filename + category = category.rstrip('.gz').rstrip('.nii') + + excl_tags = ['sub-', 'ses-', 'task-', 'run-', 'acq-'] + + # len(filetag) == 1 is temporary for broken/missing ses-* tag + for filetag in filename.split("_"): + for exctag in excl_tags: + if exctag in filetag or len(filetag) == 1: + category = category.replace(f'{filetag}_', '') + + # this provides a way to safely identify the specific file + # without relying on a full string of the filename (because + # this can change between versions depending on what any given + # processing tool appends to output file names) + nums_in_folder = [int(s) for s in folder if s.isdigit()] + nums_in_filename = [int(s) for s in filename if s.isdigit()] + + file_nums = '' + + for num in nums_in_folder: + file_nums = file_nums + str(num) + + for num in nums_in_filename: + file_nums = file_nums + str(num) + + # load these settings into the tuple so that the file can be + # identified without relying on its full path (as it would be + # impossible to match files from two regression tests just + # based on their filepaths) + file_tuple = (category, midpath, file_nums) + + temp_dict = {} + temp_dict[file_tuple] = [real_filepath] + + if category not in files_dict.keys(): + files_dict[category] = {} + + files_dict[category].update(temp_dict) + + return files_dict + + +def gather_all_files(input_dct, pickle_dir, source='output_dir'): + + file_dct_list = [] + + for key, pipe_dct in input_dct['pipelines'].items(): + + pipe_outdir = pipe_dct[source] + + if input_dct['settings']['s3_creds']: + if not "s3://" in pipe_outdir: + err = "\n\n[!] If pulling output files from an S3 bucket, the "\ + "output folder path must have the s3:// prefix.\n\n" + raise Exception(err) + else: + pipe_outdir = os.path.abspath(pipe_outdir).rstrip('/') + + pipeline_name = pipe_outdir.split('/')[-1] + + #if source == "output_dir" and "pipeline_" not in pipeline_name: + # err = "\n\n[!] Your pipeline output directory has to be a specific " \ + # "one that has the 'pipeline_' prefix.\n\n(Not the main output " \ + # "directory that contains all of the 'pipeline_X' subdirectories," \ + # "and not a specific participant's output subdirectory either.)\n" + # raise Exception(err) + + output_pkl = os.path.join(pickle_dir, "{0}_{1}_paths.p".format(key, source)) + + if os.path.exists(output_pkl): + print("Found output list pickle for {0}, skipping output file" \ + "path parsing..".format(key)) + pipeline_files_dct = read_pickle(output_pkl) + else: + if input_dct['settings']['s3_creds']: + pipeline_files_list = pull_NIFTI_file_list_from_s3(pipe_outdir, + input_dct['settings']['s3_creds']) + else: + pipeline_files_list = gather_local_filepaths(pipe_outdir) + + pipeline_files_dct = create_unique_file_dict(pipeline_files_list, + pipe_outdir, + pipe_dct['replacements']) + + write_pickle(pipeline_files_dct, output_pkl) + + file_dct_list.append(pipeline_files_dct) + + return (file_dct_list[0], file_dct_list[1]) + + +def match_filepaths(old_files_dict, new_files_dict): + """Returns a dictionary mapping each filepath from the first CPAC run to the + second one, matched to derivative, strategy, and scan. + + old_files_dict: each key is a derivative name, and each value is another + dictionary keying (derivative, mid-path, last digit in path) + tuples to a list containing the full filepath described by + the tuple that is the key + new_files_dict: same as above, but for the second CPAC run + + matched_path_dict: same as the input dictionaries, except the list in the + sub-dictionary value has both file paths that are matched + """ + + # file path matching + matched_path_dict = {} + missing_in_old = [] + missing_in_new = [] + + for key in new_files_dict: + # for types of derivative... + if key in old_files_dict.keys(): + for file_id in new_files_dict[key]: + if file_id in old_files_dict[key].keys(): + + if key not in matched_path_dict.keys(): + matched_path_dict[key] = {} + + matched_path_dict[key][file_id] = \ + old_files_dict[key][file_id] + new_files_dict[key][file_id] + + else: + missing_in_old.append(file_id)#new_files_dict[key][file_id]) + else: + missing_in_old.append(new_files_dict[key]) + + # find out what is in the last version's outputs that isn't in the new + # version's outputs + for key in old_files_dict: + if new_files_dict.get(key) != None: + missing_in_new.append(old_files_dict[key]) + + if len(matched_path_dict) == 0: + err = "\n\n[!] No output paths were successfully matched between " \ + "the two CPAC output directories!\n\n" + raise Exception(err) + + matched_files_dct = { + "matched": matched_path_dict, + "missing_old": missing_in_old, + "missing_new": missing_in_new + } + + return matched_files_dct + + +def report_missing(matched_dct, pipelines, output_dir): + + flat_missing_dct = {'missing_old': {}, 'missing_new': {}} + + for missing_type in flat_missing_dct: + for subdct in matched_dct[missing_type]: + if type(subdct) is not dict: + continue + for key, path_list in subdct.items(): + if key[0] not in flat_missing_dct[missing_type].keys(): + flat_missing_dct[missing_type][key[0]] = [] + flat_missing_dct[missing_type][key[0]].append(path_list[0]) + + report_msg = "" + + if flat_missing_dct['missing_new']: + report_msg += "\nThese outputs are in {0}, and are either missing " \ + "in {1} or were not picked up by this script's file parsing:" \ + "\n\n".format(list(pipelines)[0], list(pipelines)[1]) + for output_type in flat_missing_dct['missing_new']: + report_msg += "\n{0}:\n\n".format(output_type) + for path in flat_missing_dct['missing_new'][output_type]: + report_msg += " {0}\n".format(path) + report_file = os.path.join(output_dir, "report_missing_new.txt") + with open(report_file, 'wt') as f: + f.write(report_msg) + + if flat_missing_dct['missing_old']: + report_msg += "\nThese outputs are in {0}, and missing " \ + "in {1} or were not picked up by this script's file parsing:" \ + "\n\n".format(list(pipelines)[1], list(pipelines)[0]) + for output_type in flat_missing_dct['missing_old']: + report_msg += "\n{0}:\n\n".format(output_type) + for path in flat_missing_dct['missing_old'][output_type]: + report_msg += " {0}\n".format(path) + report_file = os.path.join(output_dir, "report_missing_old.txt") + with open(report_file, 'wt') as f: + f.write(report_msg) + + +def calculate_correlation(args_tuple): + + import os + import subprocess + import nibabel as nb + import numpy as np + import scipy.stats.mstats + import scipy.stats + import math + + category = args_tuple[0] + old_path = args_tuple[1] + new_path = args_tuple[2] + local_dir = args_tuple[3] + s3_creds = args_tuple[4] + verbose = args_tuple[5] + + if verbose: + print("Calculating correlation between {0} and {1}".format(old_path, new_path)) + + corr_tuple = None + + if s3_creds: + try: + # full filepath with filename + old_local_file = os.path.join(local_dir, "s3_input_files", \ + old_path.replace("s3://","")) + # directory without filename + old_local_path = old_local_file.replace(old_path.split("/")[-1],"") + + new_local_file = os.path.join(local_dir, "s3_input_files", \ + new_path.replace("s3://","")) + new_local_path = new_local_file.replace(new_path.split("/")[-1],"") + + if not os.path.exists(old_local_path): + os.makedirs(old_local_path) + if not os.path.exists(new_local_path): + os.makedirs(new_local_path) + + except Exception as e: + err = "\n\nLocals: {0}\n\n[!] Could not create the local S3 " \ + "download directory.\n\nError details: {1}\n\n".format((locals(), e)) + raise Exception(e) + + try: + if not os.path.exists(old_local_file): + old_path = download_from_s3(old_path, old_local_path, s3_creds) + else: + old_path = old_local_file + except Exception as e: + err = "\n\nLocals: {0}\n\n[!] Could not download the files from " \ + "the S3 bucket. \nS3 filepath: {1}\nLocal destination: {2}" \ + "\nS3 creds: {3}\n\nError details: {4}\n\n".format(locals(), + old_path, + old_local_path, + s3_creds, e) + raise Exception(e) + + try: + if not os.path.exists(new_local_file): + new_path = download_from_s3(new_path, new_local_path, s3_creds) + else: + new_path = new_local_file + except Exception as e: + err = "\n\nLocals: {0}\n\n[!] Could not download the files from " \ + "the S3 bucket. \nS3 filepath: {1}\nLocal destination: {2}" \ + "\nS3 creds: {3}\n\nError details: {4}\n\n".format(locals(), + new_path, + new_local_path, + s3_creds, e) + raise Exception(e) + + ## nibabel to pull the data from the re-assembled file paths + if os.path.exists(old_path) and os.path.exists(new_path): + + if ('.csv' in old_path and '.csv' in new_path) or \ + ('spatial_map_timeseries.txt' in old_path and 'spatial_map_timeseries.txt' in new_path) or \ + ('.1D' in old_path and '.1D' in new_path) or \ + ('.tsv' in old_path and '.tsv' in new_path): + try: + concor, pearson = correlate_text_based(old_path, new_path) + + if concor > 0.980: + corr_tuple = (category, [concor], [pearson]) + else: + corr_tuple = (category, [concor], [pearson], (old_path, new_path)) + if verbose: + print("Success - {0}".format(str(concor))) + + except Exception as e: + corr_tuple = ("file reading problem: {0}".format(e), + old_path, new_path) + if verbose: + print(str(corr_tuple)) + + return corr_tuple + + else: + try: + old_file_img = nb.load(old_path) + old_file_hdr = old_file_img.header + new_file_img = nb.load(new_path) + new_file_hdr = new_file_img.header + + old_file_dims = old_file_hdr.get_zooms() + new_file_dims = new_file_hdr.get_zooms() + + data_1 = nb.load(old_path).get_fdata() + data_2 = nb.load(new_path).get_fdata() + + except Exception as e: + corr_tuple = ("file reading problem: {0}".format(e), + old_path, new_path) + if verbose: + print(str(corr_tuple)) + return corr_tuple + + ## set up and run the Pearson correlation and concordance correlation + if data_1.flatten().shape == data_2.flatten().shape: + try: + if len(old_file_dims) > 3: + axis = tuple(range(3, len(old_file_dims))) + concor, pearson = batch_correlate(data_1, data_2, axis=axis) + concor = np.nanmean(concor) + pearson = np.nanmean(pearson) + else: + concor, pearson = batch_correlate(data_1, data_2) + except Exception as e: + corr_tuple = ("correlating problem: {0}".format(e), + old_path, new_path) + if verbose: + print(str(corr_tuple)) + return corr_tuple + if concor > 0.980: + corr_tuple = (category, [concor], [pearson]) + else: + corr_tuple = (category, [concor], [pearson], (old_path, new_path)) + if verbose: + print("Success - {0}".format(str(concor))) + else: + corr_tuple = ("different shape", old_path, new_path) + if verbose: + print(str(corr_tuple)) + + else: + if not os.path.exists(old_path): + corr_tuple = ("file doesn't exist", [old_path], None) + if verbose: + print(str(corr_tuple)) + if not os.path.exists(new_path): + if not corr_tuple: + corr_tuple = ("file doesn't exist", [new_path], None) + if verbose: + print(str(corr_tuple)) + else: + corr_tuple = ("file doesn't exist", old_path, new_path) + if verbose: + print(str(corr_tuple)) + + return corr_tuple + + +def run_correlations(matched_dct, input_dct, source='output_dir', quick=False, verbose=False): + + all_corr_dct = { + 'pearson': {}, + 'concordance': {}, + 'sub_optimal': {} + } + + args_list = [] + + quick_list = [ + 'anatomical_brain', + 'anatomical_csf_mask', + 'anatomical_gm_mask', + 'anatomical_wm_mask', + 'anatomical_to_standard', + 'functional_preprocessed', + 'functional_brain_mask', + 'mean_functional_in_anat', + 'functional_nuisance_residuals', + 'functional_nuisance_regressors', + 'functional_to_standard', + 'roi_timeseries' + ] + + matched_path_dct = matched_dct['matched'] + output_dir = input_dct['settings']['correlations_dir'] + s3_creds = input_dct['settings']['s3_creds'] + + for category in matched_path_dct.keys(): + + if quick: + if category not in quick_list: + continue + + for file_id in matched_path_dct[category].keys(): + + old_path = matched_path_dct[category][file_id][0] + new_path = matched_path_dct[category][file_id][1] + + if source == 'work_dir': + args_list.append((file_id, old_path, new_path, output_dir, s3_creds, verbose)) + else: + args_list.append((category, old_path, new_path, output_dir, s3_creds, verbose)) + + print("\nNumber of correlations to calculate: {0}\n".format(len(args_list))) + + print("Running correlations...") + p = Pool(input_dct['settings']['n_cpus']) + corr_tuple_list = p.map(calculate_correlation, args_list) + p.close() + p.join() + + print("\nCorrelations of the {0} are done.\n".format(source)) + + for corr_tuple in corr_tuple_list: + if not corr_tuple: + continue + if corr_tuple[0] not in all_corr_dct['concordance'].keys(): + all_corr_dct['concordance'][corr_tuple[0]] = [] + if corr_tuple[0] not in all_corr_dct['pearson'].keys(): + all_corr_dct['pearson'][corr_tuple[0]] = [] + all_corr_dct['concordance'][corr_tuple[0]] += corr_tuple[1] + all_corr_dct['pearson'][corr_tuple[0]] += corr_tuple[2] + + if len(corr_tuple) > 3: + if corr_tuple[0] not in all_corr_dct['sub_optimal'].keys(): + all_corr_dct['sub_optimal'][corr_tuple[0]] = [] + try: + all_corr_dct['sub_optimal'][corr_tuple[0]].append("{0}:\n{1}\n{2}" + "\n\n".format(corr_tuple[1][0], + corr_tuple[3][0], + corr_tuple[3][1])) + except TypeError: + pass + + return all_corr_dct + + +def post180_organize_correlations(concor_dct, corr_type="concordance", quick=False): + + corr_map_dct = {"correlations": {}} + for key in concor_dct: + if "problem" in key: + continue + # shouldn't need this - FIX + rawkey = key.replace('acq-', '').replace('run-', '') + datatype = rawkey.split("_")[-1] + + if datatype not in corr_map_dct["correlations"]: + corr_map_dct["correlations"][datatype] = {} + corr_map_dct["correlations"][datatype][rawkey] = concor_dct[key] + + return corr_map_dct + + +def organize_correlations(concor_dict, corr_type="concordance", quick=False): + # break up all of the correlations into groups - each group of derivatives + # will go into its own boxplot + + regCorrMap = {} + native_outputs = {} + template_outputs = {} + timeseries = {} + functionals = {} + + core = {} + + corr_map_dict = {} + corr_map_dict["correlations"] = {} + + derivs = [ + 'alff', + 'dr_tempreg', + 'reho', + 'sca_roi', + 'timeseries', + 'ndmg'] + anats = [ + 'anatomical', + 'seg' + ] + time_series = [ + 'functional_freq', + 'nuisance_residuals', + 'functional_preprocessed', + 'functional_to_standard', + 'ica_aroma_', + 'motion_correct', + 'slice_time', + ] + funcs = [ + 'functional', + 'displacement'] + + for key in concor_dict: + + if quick: + core[key] = concor_dict[key] + continue + + if 'xfm' in key or 'mixel' in key: + continue + + if 'centrality' in key or 'vmhc' in key or 'sca_tempreg' in key: + template_outputs[key] = concor_dict[key] + continue + + for word in anats: + if word in key: + regCorrMap[key] = concor_dict[key] + continue + + for word in derivs: + if word in key and 'standard' not in key: + native_outputs[key] = concor_dict[key] + continue + elif word in key: + template_outputs[key] = concor_dict[key] + continue + + for word in time_series: + if word in key and 'mean' not in key and 'mask' not in key: + timeseries[key] = concor_dict[key] + continue + + for word in funcs: + if word in key: + functionals[key] = concor_dict[key] + + if quick: + group = "{0}_core_outputs".format(corr_type) + if len(core.values()) > 0: + corr_map_dict["correlations"][group] = core + else: + print("No values in {0}".format(group)) + return corr_map_dict + + group = "{0}_registration_and_segmentation".format(corr_type) + if len(regCorrMap.values()) > 0: + corr_map_dict["correlations"][group] = regCorrMap + else: + print("No values in {0}".format(group)) + + group = "{0}_native_space_outputs".format(corr_type) + if len(native_outputs.values()) > 0: + corr_map_dict["correlations"][group] = native_outputs + else: + print("No values in {0}".format(group)) + + group = "{0}_template_space_outputs".format(corr_type) + if len(template_outputs.values()) > 0: + corr_map_dict["correlations"][group] = template_outputs + else: + print("No values in {0}".format(group)) + + group = "{0}_timeseries_outputs".format(corr_type) + if len(timeseries.values()) > 0: + corr_map_dict["correlations"][group] = timeseries + else: + print("No values in {0}".format(group)) + + group = "{0}_functional_outputs".format(corr_type) + if len(functionals.values()) > 0: + corr_map_dict["correlations"][group] = functionals + else: + print("No values in {0}".format(group)) + + return corr_map_dict + + +def quick_summary(corr_map_dct, output_dir): + for corr_group in corr_map_dct["correlations"].keys(): + cat_dct = {} + lines = [] + for output_type, corr_vec in dict(corr_map_dct["correlations"][corr_group]).items(): + try: + corrmean = np.mean(np.asarray(corr_vec)) + except TypeError: + continue + lines.append("{0}: {1}".format(output_type, corrmean)) + + write_txt_file(lines, os.path.join(output_dir, "average_{0}.txt".format(corr_group))) + + +def create_boxplot(corr_group, corr_group_name, pipeline_names=None, + current_dir=None): + + import os + import numpy as np + from matplotlib import pyplot + + if not pipeline_names: + pipeline_names = ["pipeline_1", "pipeline_2"] + if not current_dir: + current_dir = os.getcwd() + + allData = [] + labels = list(corr_group.keys()) + labels.sort() + + for label in labels: + if "file reading problem" in label: + continue + try: + allData.append(np.asarray(corr_group[label]).astype(float)) + except ValueError as ve: + continue + #raise Exception(ve) + + pyplot.boxplot(allData) + pyplot.xticks(range(1,(len(corr_group)+1)),labels,rotation=85) + pyplot.margins(0.5,1.0) + #pyplot.ylim(0.5,1.2) + pyplot.xlabel('Derivatives') + pyplot.title('Correlations between {0} and {1}\n ' + '( {2} )'.format(list(pipeline_names)[0], + list(pipeline_names)[1], + corr_group_name)) + + output_filename = os.path.join(current_dir, + (corr_group_name + "_" + + list(pipeline_names)[0] + + "_and_" + list(pipeline_names)[1])) + + pyplot.savefig('{0}.png'.format(output_filename), format='png', dpi=200, bbox_inches='tight') + pyplot.close() + + +def compare_pipelines(input_dct, dir_type='output_dir'): + + output_dir = input_dct['settings']['output_dir'] + pickle_dir = input_dct['settings']['pickle_dir'] + + corrs_pkl = os.path.join(pickle_dir, "{0}_correlations.p".format(dir_type)) + matched_pkl = os.path.join(pickle_dir, "{0}_matched_files.p".format(dir_type)) + + all_corr_dct = None + if os.path.exists(corrs_pkl): + print("\n\nFound the correlations pickle: {0}\n\n" + "Starting from there..\n".format(corrs_pkl)) + all_corr_dct = read_pickle(corrs_pkl) + elif os.path.exists(matched_pkl): + print("\n\nFound the matched filepaths pickle: {0}\n\n" + "Starting from there..\n".format(matched_pkl)) + matched_dct = read_pickle(matched_pkl) + + if dir_type == 'output_dir': + report_missing(matched_dct, input_dct["pipelines"].keys(), output_dir) + + else: + # gather all relevant output and working files + outfiles1_dct, outfiles2_dct = gather_all_files(input_dct, pickle_dir, + source=dir_type) + + matched_dct = match_filepaths(outfiles1_dct, outfiles2_dct) + write_pickle(matched_dct, matched_pkl) + + if dir_type == 'output_dir': + report_missing(matched_dct, input_dct["pipelines"].keys(), output_dir) + + if not all_corr_dct: + all_corr_dct = run_correlations(matched_dct, + input_dct, + source=dir_type, + quick=input_dct['settings']['quick'], + verbose=input_dct['settings']['verbose']) + write_pickle(all_corr_dct, corrs_pkl) + + if dir_type == 'work_dir': + sorted_vals = [] + #sorted_keys = sorted(all_corr_dct, key=all_corr_dct.get) + for key in all_corr_dct.keys(): #sorted_keys: + if 'file reading problem:' in key or 'different shape' in key or 'correlating problem' in key: + continue + else: + sorted_vals.append("{0}: {1}".format(all_corr_dct[key], key)) + working_corrs_file = os.path.join(output_dir, "work_dir_correlations.txt") + with open(working_corrs_file, 'wt') as f: + for line in sorted_vals: + f.write(line) + f.write("\n") + + else: + pre180 = False + if pre180: + organize = organize_correlations + else: + organize = post180_organize_correlations + + corr_map_dict = organize(all_corr_dct["concordance"], "concordance", + quick=input_dct['settings']['quick']) + corr_map_dict["pipeline_names"] = input_dct["pipelines"].keys() + + pearson_map_dict = organize(all_corr_dct["pearson"], "pearson", + quick=input_dct['settings']['quick']) + pearson_map_dict["pipeline_names"] = input_dct["pipelines"].keys() + + quick_summary(corr_map_dict, output_dir) + quick_summary(pearson_map_dict, output_dir) + + if all_corr_dct['sub_optimal']: + write_yml_file(all_corr_dct['sub_optimal'], os.path.join(output_dir, "sub_optimal.yml")) + + for corr_group_name in corr_map_dict["correlations"].keys(): + corr_group = corr_map_dict["correlations"][corr_group_name] + create_boxplot(corr_group, corr_group_name, + corr_map_dict["pipeline_names"], output_dir) + + for corr_group_name in pearson_map_dict["correlations"].keys(): + corr_group = pearson_map_dict["correlations"][corr_group_name] + create_boxplot(corr_group, corr_group_name, + pearson_map_dict["pipeline_names"], output_dir) + + +def main(): + + import os + import argparse + + from multiprocessing import Pool + import itertools + + parser = argparse.ArgumentParser() + parser.add_argument("input_yaml", type=str, + help="file path of the script's input YAML") + args = parser.parse_args() + + # get the input info + input_dct = read_yml_file(args.input_yaml) + + # check for already completed stuff (pickles) + output_dir = os.path.join(os.getcwd(), + "correlations_{0}".format(input_dct['settings']['run_name'])) + pickle_dir = os.path.join(output_dir, "pickles") + + if not os.path.exists(pickle_dir): + try: + os.makedirs(pickle_dir) + except: + err = "\n\n[!] Could not create the output directory for the " \ + "correlations. Do you have write permissions?\nAttempted " \ + "output directory: {0}\n\n".format(output_dir) + raise Exception(err) + + input_dct['settings'].update({'output_dir': output_dir}) + input_dct['settings'].update({'pickle_dir': pickle_dir}) + + compare_pipelines(input_dct, dir_type='output_dir') + #compare_pipelines(input_dct, dir_type='work_dir') + + +if __name__ == "__main__": + main() diff --git a/cpac_data_config_regtest.yml b/cpac_data_config_regtest.yml index 9023ebf..2179b62 100644 --- a/cpac_data_config_regtest.yml +++ b/cpac_data_config_regtest.yml @@ -88,7 +88,7 @@ site_id: Site-CBIC subject_id: sub-NDARAB348EWR unique_id: '1' -- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/anat/sub-NDARAB458VK9_acq-vNavNorm_run-01_T1w.nii.gz +- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/anat/sub-NDARAB458VK9_acq-VNavNorm_run-01_T1w.nii.gz fmap: epi_AP: scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/fmap/sub-NDARAB458VK9_dir-AP_acq-fMRI_epi.nii.gz diff --git a/cpac_pipe_diff.py b/cpac_pipe_diff.py index e434169..a832856 100644 --- a/cpac_pipe_diff.py +++ b/cpac_pipe_diff.py @@ -21,7 +21,9 @@ def read_yaml_file(yaml_file): ... 'pipeline_setup']['pipeline_name'] 'cpac-default-pipeline' ''' - return yaml.safe_load(open(yaml_file, 'r')) + with open(yaml_file, 'r') as f: + yaml_dct = yaml.safe_load(f) + return yaml_dct def isclose(a, b, rel_tol=1e-09, abs_tol=0.0): @@ -101,4 +103,8 @@ def main(): diff_dct = dct_diff(pipe_dct1, pipe_dct2) for key in diff_dct: - print("{0}: {1}".format(key, diff_dct[key])) + print("{0}:\n{1}\n\n".format(key, diff_dct[key])) + + +if __name__ == "__main__": + main() diff --git a/data_config_regtest.yml b/data_config_regtest.yml index d6cf437..0d22179 100644 --- a/data_config_regtest.yml +++ b/data_config_regtest.yml @@ -1,19 +1,14 @@ -# CPAC Data Configuration File -# Version 1.4.3 -# -# http://fcp-indi.github.io for more info. -# -# Tip: This file can be edited manually with a text editor for quick modifications. +# C-PAC Testing Data Configuration File +# v1.6.2 +# +# this is a cross-section of multiple datasets meant for the C-PAC release regression test - -# ADHD200 data -# for a large number of participants for group-level analyses - anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-1019436/ses-1/anat/sub-1019436_ses-1_run-1_T1w.nii.gz func: rest_acq-1_run-1: scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-1019436/ses-1/func/sub-1019436_ses-1_task-rest_acq-1_run-1_bold.nii.gz scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/task-rest_acq-1_bold.json - site: KKI + site_id: KKI subject_id: '1019436' unique_id: '1' - anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-2014113/ses-1/anat/sub-2014113_ses-1_run-1_T1w.nii.gz @@ -29,7 +24,7 @@ rest_acq-2_run-1: scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-3154996/ses-1/func/sub-3154996_ses-1_task-rest_acq-2_run-1_bold.nii.gz scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/task-rest_acq-2_bold.json - site: KKI + site_id: KKI subject_id: '3154996' unique_id: '1' - anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-3699991/ses-1/anat/sub-3699991_ses-1_run-1_T1w.nii.gz @@ -37,7 +32,7 @@ rest_acq-1_run-1: scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-3699991/ses-1/func/sub-3699991_ses-1_task-rest_acq-1_run-1_bold.nii.gz scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/task-rest_acq-1_bold.json - site: KKI + site_id: KKI subject_id: '3699991' unique_id: '1' - anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-3884955/ses-1/anat/sub-3884955_ses-1_run-1_T1w.nii.gz @@ -45,448 +40,550 @@ rest_acq-2_run-1: scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-3884955/ses-1/func/sub-3884955_ses-1_task-rest_acq-2_run-1_bold.nii.gz scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/task-rest_acq-2_bold.json - site: KKI + site_id: KKI subject_id: '3884955' unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-3902469/ses-1/anat/sub-3902469_ses-1_run-1_T1w.nii.gz - func: - rest_acq-1_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-3902469/ses-1/func/sub-3902469_ses-1_task-rest_acq-1_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/task-rest_acq-1_bold.json - site: KKI - subject_id: '3902469' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-4275075/ses-1/anat/sub-4275075_ses-1_run-1_T1w.nii.gz - func: - rest_acq-2_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-4275075/ses-1/func/sub-4275075_ses-1_task-rest_acq-2_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/task-rest_acq-2_bold.json - site: KKI - subject_id: '4275075' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-7774305/ses-1/anat/sub-7774305_ses-1_run-1_T1w.nii.gz - func: - rest_acq-1_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-7774305/ses-1/func/sub-7774305_ses-1_task-rest_acq-1_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/task-rest_acq-1_bold.json - site: KKI - subject_id: '7774305' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-0010042/ses-1/anat/sub-0010042_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-0010042/ses-1/func/sub-0010042_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/task-rest_bold.json - site: NYU - subject_id: '0010042' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-0010064/ses-1/anat/sub-0010064_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-0010064/ses-1/func/sub-0010064_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/task-rest_bold.json - site: NYU - subject_id: '0010064' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-0010128/ses-1/anat/sub-0010128_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-0010128/ses-1/func/sub-0010128_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/task-rest_bold.json - site: NYU - subject_id: 0010128 - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-0021019/ses-1/anat/sub-0021019_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-0021019/ses-1/func/sub-0021019_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/task-rest_bold.json - site: NYU - subject_id: 0021019 - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-2497695/ses-1/anat/sub-2497695_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-2497695/ses-1/func/sub-2497695_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/task-rest_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-2497695/ses-1/func/sub-2497695_ses-1_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/task-rest_bold.json - site: NYU - subject_id: '2497695' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-4164316/ses-1/anat/sub-4164316_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/sub-4164316/ses-1/func/sub-4164316_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NYU/task-rest_bold.json - site: NYU - subject_id: '4164316' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-0027037/ses-1/anat/sub-0027037_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-0027037/ses-1/func/sub-0027037_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/task-rest_bold.json - site: NeuroIMAGE - subject_id: '0027037' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-3007585/ses-1/anat/sub-3007585_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-3007585/ses-1/func/sub-3007585_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/task-rest_bold.json - site: NeuroIMAGE - subject_id: '3007585' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-4134561/ses-1/anat/sub-4134561_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-4134561/ses-1/func/sub-4134561_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/task-rest_bold.json - site: NeuroIMAGE - subject_id: '4134561' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-6115230/ses-1/anat/sub-6115230_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-6115230/ses-1/func/sub-6115230_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/task-rest_bold.json - site: NeuroIMAGE - subject_id: '6115230' +- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA504CRN/anat/sub-NDARAA504CRN_acq-VNavNorm_T1w.nii.gz + fmap: + epi_AP: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA504CRN/fmap/sub-NDARAA504CRN_dir-AP_acq-fMRI_epi.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA504CRN/fmap/sub-NDARAA504CRN_dir-AP_acq-fMRI_epi.json + epi_PA: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA504CRN/fmap/sub-NDARAA504CRN_dir-PA_acq-fMRI_epi.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA504CRN/fmap/sub-NDARAA504CRN_dir-PA_acq-fMRI_epi.json + func: + task-movieTP: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA504CRN/func/sub-NDARAA504CRN_task-movieTP_bold.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA504CRN/func/sub-NDARAA504CRN_task-movieTP_bold.json + site_id: Site-CBIC + subject_id: sub-NDARAA504CRN unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-8409791/ses-1/anat/sub-8409791_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/sub-8409791/ses-1/func/sub-8409791_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/NeuroIMAGE/task-rest_bold.json - site: NeuroIMAGE - subject_id: '8409791' - unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-0023008/ses-1/anat/sub-0023008_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-0023008/ses-1/func/sub-0023008_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - site: OHSU - subject_id: 0023008 +- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA947ZG5/anat/sub-NDARAA947ZG5_acq-VNavNorm_T1w.nii.gz + fmap: + epi_AP: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA947ZG5/fmap/sub-NDARAA947ZG5_dir-AP_acq-fMRI_epi.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA947ZG5/fmap/sub-NDARAA947ZG5_dir-AP_acq-fMRI_epi.json + epi_PA: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA947ZG5/fmap/sub-NDARAA947ZG5_dir-PA_acq-fMRI_epi.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA947ZG5/fmap/sub-NDARAA947ZG5_dir-PA_acq-fMRI_epi.json + func: + task-movieTP: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA947ZG5/func/sub-NDARAA947ZG5_task-movieTP_bold.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAA947ZG5/func/sub-NDARAA947ZG5_task-movieTP_bold.json + site_id: Site-CBIC + subject_id: sub-NDARAA947ZG5 unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-0023012/ses-1/anat/sub-0023012_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-0023012/ses-1/func/sub-0023012_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - site: OHSU - subject_id: '0023012' +- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB348EWR/anat/sub-NDARAB348EWR_acq-VNavNorm_run-01_T1w.nii.gz + fmap: + epi_AP: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB348EWR/fmap/sub-NDARAB348EWR_dir-AP_acq-fMRI_epi.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB348EWR/fmap/sub-NDARAB348EWR_dir-AP_acq-fMRI_epi.json + epi_PA: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB348EWR/fmap/sub-NDARAB348EWR_dir-PA_acq-fMRI_epi.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB348EWR/fmap/sub-NDARAB348EWR_dir-PA_acq-fMRI_epi.json + func: + task-movieTP: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB348EWR/func/sub-NDARAB348EWR_task-movieTP_bold.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB348EWR/func/sub-NDARAB348EWR_task-movieTP_bold.json + site_id: Site-CBIC + subject_id: sub-NDARAB348EWR unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1206380/ses-1/anat/sub-1206380_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1206380/ses-1/func/sub-1206380_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1206380/ses-1/func/sub-1206380_ses-1_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - rest_run-3: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1206380/ses-1/func/sub-1206380_ses-1_task-rest_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - site: OHSU - subject_id: '1206380' +- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/anat/sub-NDARAB458VK9_acq-VNavNorm_run-01_T1w.nii.gz + fmap: + epi_AP: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/fmap/sub-NDARAB458VK9_dir-AP_acq-fMRI_epi.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/fmap/sub-NDARAB458VK9_dir-AP_acq-fMRI_epi.json + epi_PA: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/fmap/sub-NDARAB458VK9_dir-PA_acq-fMRI_epi.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/fmap/sub-NDARAB458VK9_dir-PA_acq-fMRI_epi.json + func: + task-movieTP: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/func/sub-NDARAB458VK9_task-movieTP_bold.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC/sub-NDARAB458VK9/func/sub-NDARAB458VK9_task-movieTP_bold.json + site_id: Site-CBIC + subject_id: sub-NDARAB458VK9 unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1418396/ses-1/anat/sub-1418396_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1418396/ses-1/func/sub-1418396_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1418396/ses-1/func/sub-1418396_ses-1_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - rest_run-3: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1418396/ses-1/func/sub-1418396_ses-1_task-rest_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - site: OHSU - subject_id: '1418396' +- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/anat/sub-NDARAD481FXF_T1w.nii.gz + fmap: + diffmag: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/fmap/sub-NDARAD481FXF_magnitude1.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/fmap/sub-NDARAD481FXF_magnitude1.json + diffmag_two: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/fmap/sub-NDARAD481FXF_magnitude2.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/fmap/sub-NDARAD481FXF_magnitude2.json + diffphase: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/fmap/sub-NDARAD481FXF_phasediff.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/fmap/sub-NDARAD481FXF_phasediff.json + func: + task-rest: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/func/sub-NDARAD481FXF_task-rest_bold.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAD481FXF/func/sub-NDARAD481FXF_task-rest_bold.json + site_id: Site-SI + subject_id: sub-NDARAD481FXF unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1552181/ses-1/anat/sub-1552181_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1552181/ses-1/func/sub-1552181_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1552181/ses-1/func/sub-1552181_ses-1_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - rest_run-3: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1552181/ses-1/func/sub-1552181_ses-1_task-rest_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - site: OHSU - subject_id: '1552181' +- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/anat/sub-NDARAV894XWD_T1w.nii.gz + fmap: + diffmag: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/fmap/sub-NDARAV894XWD_magnitude1.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/fmap/sub-NDARAV894XWD_magnitude1.json + diffmag_two: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/fmap/sub-NDARAV894XWD_magnitude2.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/fmap/sub-NDARAV894XWD_magnitude2.json + diffphase: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/fmap/sub-NDARAV894XWD_phasediff.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/fmap/sub-NDARAV894XWD_phasediff.json + func: + task-rest: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/func/sub-NDARAV894XWD_task-rest_bold.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARAV894XWD/func/sub-NDARAV894XWD_task-rest_bold.json + site_id: Site-SI + subject_id: sub-NDARAV894XWD unique_id: '1' -- anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1679142/ses-1/anat/sub-1679142_ses-1_run-1_T1w.nii.gz - func: - rest_run-1: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1679142/ses-1/func/sub-1679142_ses-1_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1679142/ses-1/func/sub-1679142_ses-1_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - rest_run-3: - scan: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/sub-1679142/ses-1/func/sub-1679142_ses-1_task-rest_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/OHSU/task-rest_bold.json - site: OHSU - subject_id: '1679142' +- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/anat/sub-NDARCA186WGH_T1w.nii.gz + fmap: + diffmag: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/fmap/sub-NDARCA186WGH_magnitude1.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/fmap/sub-NDARCA186WGH_magnitude1.json + diffmag_two: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/fmap/sub-NDARCA186WGH_magnitude2.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/fmap/sub-NDARCA186WGH_magnitude2.json + diffphase: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/fmap/sub-NDARCA186WGH_phasediff.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/fmap/sub-NDARCA186WGH_phasediff.json + func: + task-rest: + scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/func/sub-NDARCA186WGH_task-rest_bold.nii.gz + scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-SI/sub-NDARCA186WGH/func/sub-NDARCA186WGH_task-rest_bold.json + site_id: Site-SI + subject_id: sub-NDARCA186WGH unique_id: '1' - - -# NKI-Rockland Sample NFB3 data -# for field maps -- anat: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/anat/sub-A00028185_ses-NFB3_T1w.nii.gz - func: - DMNTRACKINGTEST: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/func/sub-A00028185_ses-NFB3_task-DMNTRACKINGTEST_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-DMNTRACKINGTEST_bold.json - DMNTRACKINGTRAIN: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/func/sub-A00028185_ses-NFB3_task-DMNTRACKINGTRAIN_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-DMNTRACKINGTRAIN_bold.json - MASK: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/func/sub-A00028185_ses-NFB3_task-MASK_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MASK_bold.json - MORALDILEMMA: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/func/sub-A00028185_ses-NFB3_task-MORALDILEMMA_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MORALDILEMMA_bold.json - MSIT: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/func/sub-A00028185_ses-NFB3_task-MSIT_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MSIT_bold.json - PEER1: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/func/sub-A00028185_ses-NFB3_task-PEER1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-PEER1_bold.json - PEER2: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/fmap/sub-A00028185_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028185/ses-NFB3/func/sub-A00028185_ses-NFB3_task-PEER2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-PEER2_bold.json - site: NKI - subject_id: A00028185 - unique_id: NFB3 -- anat: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/anat/sub-A00028352_ses-NFB3_T1w.nii.gz - func: - DMNTRACKINGTEST: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/func/sub-A00028352_ses-NFB3_task-DMNTRACKINGTEST_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-DMNTRACKINGTEST_bold.json - DMNTRACKINGTRAIN: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/func/sub-A00028352_ses-NFB3_task-DMNTRACKINGTRAIN_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-DMNTRACKINGTRAIN_bold.json - MASK: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/func/sub-A00028352_ses-NFB3_task-MASK_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MASK_bold.json - MORALDILEMMA: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/func/sub-A00028352_ses-NFB3_task-MORALDILEMMA_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MORALDILEMMA_bold.json - MSIT: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/func/sub-A00028352_ses-NFB3_task-MSIT_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MSIT_bold.json - PEER1: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/func/sub-A00028352_ses-NFB3_task-PEER1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-PEER1_bold.json - PEER2: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/fmap/sub-A00028352_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00028352/ses-NFB3/func/sub-A00028352_ses-NFB3_task-PEER2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-PEER2_bold.json - site: NKI - subject_id: A00028352 - unique_id: NFB3 -- anat: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/anat/sub-A00035827_ses-NFB3_T1w.nii.gz +- anat: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025453/ses-1/anat/sub-0025453_ses-1_run-1_T1w.nii.gz + creds_path: null func: - DMNTRACKINGTEST: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/func/sub-A00035827_ses-NFB3_task-DMNTRACKINGTEST_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-DMNTRACKINGTEST_bold.json - DMNTRACKINGTRAIN: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/func/sub-A00035827_ses-NFB3_task-DMNTRACKINGTRAIN_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-DMNTRACKINGTRAIN_bold.json - MASK: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/func/sub-A00035827_ses-NFB3_task-MASK_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MASK_bold.json - MORALDILEMMA: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/func/sub-A00035827_ses-NFB3_task-MORALDILEMMA_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MORALDILEMMA_bold.json - MSIT: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/func/sub-A00035827_ses-NFB3_task-MSIT_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MSIT_bold.json - PEER1: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/func/sub-A00035827_ses-NFB3_task-PEER1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-PEER1_bold.json - PEER2: - fmap_mag: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_magnitude1.nii.gz - fmap_phase: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/fmap/sub-A00035827_ses-NFB3_phasediff.nii.gz - scan: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/sub-A00035827/ses-NFB3/func/sub-A00035827_ses-NFB3_task-PEER2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-PEER2_bold.json - site: NKI - subject_id: A00035827 - unique_id: NFB3 - - -# Healthy Brain Network (HBN) data, Site-RU -# for movies data, and PEER scans -- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/anat/sub-NDARAA948VFH_acq-HCP_T1w.nii.gz - func: - movieDM: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-movieDM_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-movieDM_bold.json - movieTP: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-movieTP_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-movieTP_bold.json - peer_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-peer_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-peer_run-1_bold.json - peer_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-peer_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-peer_run-2_bold.json - peer_run-3: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-peer_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-peer_run-3_bold.json rest_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-rest_run-1_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAA948VFH/func/sub-NDARAA948VFH_task-rest_run-2_bold.json - site: Site-RU - subject_id: NDARAA948VFH + scan: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025453/ses-1/func/sub-0025453_ses-1_task-rest_run-1_bold.nii.gz + scan_parameters: + AcquisitionDuration: '10:00' + AcquisitionMatrix: 64x64 + EchoTime: 0.03 + FieldofViewDimensions: 220x220 + FieldofViewShape: Rectangle + FlipAngle: 90 + Instructions: '''Relax and remain still with your eyes open. Do not fall asleep + and do not think about anything in particular.''' + MagneicFieldSrengh: 3 + Manufacturer: GE + ManufacturersModelName: Discovery MR750 + NumberOfSlices: 43 + NumberofMeasurements: 300 + ParallelAcquisition: 'Yes' + ParallelAcquisitionTechnique: ASSET + PhaseEncodingDirection: j- + PixelBandwidth: 3437.5 + PixelSpacing: 3.4x3.4 + PlaneOrientationSequence: Axial + PulseSequenceType: EPI + ReceiveCoilName: 8 Chan + ReceiveCoilType: Head + RepetitionTime: 2.0 + ScanOptions: FS + SliceAcquisitionOrder: Interleaved Ascending + SliceEncodingDirection: k + SliceThickness: 3.4 + SliceTiming: + - 0.0 + - 1023.26 + - 46.51 + - 1069.77 + - 93.02 + - 1116.28 + - 139.53 + - 1162.79 + - 186.05 + - 1209.3 + - 232.56 + - 1255.81 + - 279.07 + - 1302.33 + - 325.58 + - 1348.84 + - 372.09 + - 1395.35 + - 418.6 + - 1441.86 + - 465.12 + - 1488.37 + - 511.63 + - 1534.88 + - 558.14 + - 1581.4 + - 604.65 + - 1627.91 + - 651.16 + - 1674.42 + - 697.67 + - 1720.93 + - 744.19 + - 1767.44 + - 790.7 + - 1813.95 + - 837.21 + - 1860.47 + - 883.72 + - 1906.98 + - 930.23 + - 1953.49 + - 976.74 + SpacingBetweenSlices: 3.4 + TaskDescription: ' During functional scanning, subjects were presented with + a fixation cross and were instructed to keep their eyes open, relax and + move as little as possible while observing the fixation cross. Subjects + were also instructed not to engage in breath counting or meditation.' + TaskName: rest + site_id: HNU_1 + subject_id: sub-0025453 unique_id: ses-1 -- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/anat/sub-NDARAC495TJ2_acq-HCP_T1w.nii.gz +- anat: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025428/ses-1/anat/sub-0025428_ses-1_run-1_T1w.nii.gz + creds_path: null func: - movieDM: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-movieDM_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-movieDM_bold.json - movieTP: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-movieTP_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-movieTP_bold.json - peer_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-peer_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-peer_run-1_bold.json - peer_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-peer_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-peer_run-2_bold.json - peer_run-3: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-peer_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-peer_run-3_bold.json rest_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-rest_run-1_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC495TJ2/func/sub-NDARAC495TJ2_task-rest_run-2_bold.json - site: Site-RU - subject_id: NDARAC495TJ2 + scan: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025428/ses-1/func/sub-0025428_ses-1_task-rest_run-1_bold.nii.gz + scan_parameters: + AcquisitionDuration: '10:00' + AcquisitionMatrix: 64x64 + EchoTime: 0.03 + FieldofViewDimensions: 220x220 + FieldofViewShape: Rectangle + FlipAngle: 90 + Instructions: '''Relax and remain still with your eyes open. Do not fall asleep + and do not think about anything in particular.''' + MagneicFieldSrengh: 3 + Manufacturer: GE + ManufacturersModelName: Discovery MR750 + NumberOfSlices: 43 + NumberofMeasurements: 300 + ParallelAcquisition: 'Yes' + ParallelAcquisitionTechnique: ASSET + PhaseEncodingDirection: j- + PixelBandwidth: 3437.5 + PixelSpacing: 3.4x3.4 + PlaneOrientationSequence: Axial + PulseSequenceType: EPI + ReceiveCoilName: 8 Chan + ReceiveCoilType: Head + RepetitionTime: 2.0 + ScanOptions: FS + SliceAcquisitionOrder: Interleaved Ascending + SliceEncodingDirection: k + SliceThickness: 3.4 + SliceTiming: + - 0.0 + - 1023.26 + - 46.51 + - 1069.77 + - 93.02 + - 1116.28 + - 139.53 + - 1162.79 + - 186.05 + - 1209.3 + - 232.56 + - 1255.81 + - 279.07 + - 1302.33 + - 325.58 + - 1348.84 + - 372.09 + - 1395.35 + - 418.6 + - 1441.86 + - 465.12 + - 1488.37 + - 511.63 + - 1534.88 + - 558.14 + - 1581.4 + - 604.65 + - 1627.91 + - 651.16 + - 1674.42 + - 697.67 + - 1720.93 + - 744.19 + - 1767.44 + - 790.7 + - 1813.95 + - 837.21 + - 1860.47 + - 883.72 + - 1906.98 + - 930.23 + - 1953.49 + - 976.74 + SpacingBetweenSlices: 3.4 + TaskDescription: ' During functional scanning, subjects were presented with + a fixation cross and were instructed to keep their eyes open, relax and + move as little as possible while observing the fixation cross. Subjects + were also instructed not to engage in breath counting or meditation.' + TaskName: rest + site_id: HNU_1 + subject_id: sub-0025428 unique_id: ses-1 -- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/anat/sub-NDARAC853DTE_acq-HCP_T1w.nii.gz +- anat: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025429/ses-1/anat/sub-0025429_ses-1_run-1_T1w.nii.gz + creds_path: null func: - movieDM: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-movieDM_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-movieDM_bold.json - movieTP: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-movieTP_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-movieTP_bold.json - peer_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-peer_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-peer_run-1_bold.json - peer_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-peer_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-peer_run-2_bold.json - peer_run-3: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-peer_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-peer_run-3_bold.json rest_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-rest_run-1_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC853DTE/func/sub-NDARAC853DTE_task-rest_run-2_bold.json - site: Site-RU - subject_id: NDARAC853DTE + scan: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025429/ses-1/func/sub-0025429_ses-1_task-rest_run-1_bold.nii.gz + scan_parameters: + AcquisitionDuration: '10:00' + AcquisitionMatrix: 64x64 + EchoTime: 0.03 + FieldofViewDimensions: 220x220 + FieldofViewShape: Rectangle + FlipAngle: 90 + Instructions: '''Relax and remain still with your eyes open. Do not fall asleep + and do not think about anything in particular.''' + MagneicFieldSrengh: 3 + Manufacturer: GE + ManufacturersModelName: Discovery MR750 + NumberOfSlices: 43 + NumberofMeasurements: 300 + ParallelAcquisition: 'Yes' + ParallelAcquisitionTechnique: ASSET + PhaseEncodingDirection: j- + PixelBandwidth: 3437.5 + PixelSpacing: 3.4x3.4 + PlaneOrientationSequence: Axial + PulseSequenceType: EPI + ReceiveCoilName: 8 Chan + ReceiveCoilType: Head + RepetitionTime: 2.0 + ScanOptions: FS + SliceAcquisitionOrder: Interleaved Ascending + SliceEncodingDirection: k + SliceThickness: 3.4 + SliceTiming: + - 0.0 + - 1023.26 + - 46.51 + - 1069.77 + - 93.02 + - 1116.28 + - 139.53 + - 1162.79 + - 186.05 + - 1209.3 + - 232.56 + - 1255.81 + - 279.07 + - 1302.33 + - 325.58 + - 1348.84 + - 372.09 + - 1395.35 + - 418.6 + - 1441.86 + - 465.12 + - 1488.37 + - 511.63 + - 1534.88 + - 558.14 + - 1581.4 + - 604.65 + - 1627.91 + - 651.16 + - 1674.42 + - 697.67 + - 1720.93 + - 744.19 + - 1767.44 + - 790.7 + - 1813.95 + - 837.21 + - 1860.47 + - 883.72 + - 1906.98 + - 930.23 + - 1953.49 + - 976.74 + SpacingBetweenSlices: 3.4 + TaskDescription: ' During functional scanning, subjects were presented with + a fixation cross and were instructed to keep their eyes open, relax and + move as little as possible while observing the fixation cross. Subjects + were also instructed not to engage in breath counting or meditation.' + TaskName: rest + site_id: HNU_1 + subject_id: sub-0025429 unique_id: ses-1 -- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/anat/sub-NDARAC904DMU_acq-HCP_T1w.nii.gz +- anat: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025452/ses-1/anat/sub-0025452_ses-1_run-1_T1w.nii.gz + creds_path: null func: - movieDM: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-movieDM_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-movieDM_bold.json - movieTP: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-movieTP_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-movieTP_bold.json - peer_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-peer_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-peer_run-1_bold.json - peer_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-peer_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-peer_run-2_bold.json - peer_run-3: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-peer_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-peer_run-3_bold.json rest_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-rest_run-1_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAC904DMU/func/sub-NDARAC904DMU_task-rest_run-2_bold.json - site: Site-RU - subject_id: NDARAC904DMU + scan: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025452/ses-1/func/sub-0025452_ses-1_task-rest_run-1_bold.nii.gz + scan_parameters: + AcquisitionDuration: '10:00' + AcquisitionMatrix: 64x64 + EchoTime: 0.03 + FieldofViewDimensions: 220x220 + FieldofViewShape: Rectangle + FlipAngle: 90 + Instructions: '''Relax and remain still with your eyes open. Do not fall asleep + and do not think about anything in particular.''' + MagneicFieldSrengh: 3 + Manufacturer: GE + ManufacturersModelName: Discovery MR750 + NumberOfSlices: 43 + NumberofMeasurements: 300 + ParallelAcquisition: 'Yes' + ParallelAcquisitionTechnique: ASSET + PhaseEncodingDirection: j- + PixelBandwidth: 3437.5 + PixelSpacing: 3.4x3.4 + PlaneOrientationSequence: Axial + PulseSequenceType: EPI + ReceiveCoilName: 8 Chan + ReceiveCoilType: Head + RepetitionTime: 2.0 + ScanOptions: FS + SliceAcquisitionOrder: Interleaved Ascending + SliceEncodingDirection: k + SliceThickness: 3.4 + SliceTiming: + - 0.0 + - 1023.26 + - 46.51 + - 1069.77 + - 93.02 + - 1116.28 + - 139.53 + - 1162.79 + - 186.05 + - 1209.3 + - 232.56 + - 1255.81 + - 279.07 + - 1302.33 + - 325.58 + - 1348.84 + - 372.09 + - 1395.35 + - 418.6 + - 1441.86 + - 465.12 + - 1488.37 + - 511.63 + - 1534.88 + - 558.14 + - 1581.4 + - 604.65 + - 1627.91 + - 651.16 + - 1674.42 + - 697.67 + - 1720.93 + - 744.19 + - 1767.44 + - 790.7 + - 1813.95 + - 837.21 + - 1860.47 + - 883.72 + - 1906.98 + - 930.23 + - 1953.49 + - 976.74 + SpacingBetweenSlices: 3.4 + TaskDescription: ' During functional scanning, subjects were presented with + a fixation cross and were instructed to keep their eyes open, relax and + move as little as possible while observing the fixation cross. Subjects + were also instructed not to engage in breath counting or meditation.' + TaskName: rest + site_id: HNU_1 + subject_id: sub-0025452 unique_id: ses-1 -- anat: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/anat/sub-NDARAD224CRB_acq-HCP_T1w.nii.gz +- anat: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025448/ses-1/anat/sub-0025448_ses-1_run-1_T1w.nii.gz + creds_path: null func: - movieTP: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-movieTP_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-movieTP_bold.json - peer_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-peer_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-peer_run-1_bold.json - peer_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-peer_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-peer_run-2_bold.json - peer_run-3: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-peer_run-3_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-peer_run-3_bold.json rest_run-1: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-rest_run-1_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-rest_run-1_bold.json - rest_run-2: - scan: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-rest_run-2_bold.nii.gz - scan_parameters: s3://fcp-indi/data/Projects/HBN/MRI/Site-RU/sub-NDARAD224CRB/func/sub-NDARAD224CRB_task-rest_run-2_bold.json - site: Site-RU - subject_id: NDARAD224CRB - unique_id: ses-1 \ No newline at end of file + scan: s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1/sub-0025448/ses-1/func/sub-0025448_ses-1_task-rest_run-1_bold.nii.gz + scan_parameters: + AcquisitionDuration: '10:00' + AcquisitionMatrix: 64x64 + EchoTime: 0.03 + FieldofViewDimensions: 220x220 + FieldofViewShape: Rectangle + FlipAngle: 90 + Instructions: '''Relax and remain still with your eyes open. Do not fall asleep + and do not think about anything in particular.''' + MagneicFieldSrengh: 3 + Manufacturer: GE + ManufacturersModelName: Discovery MR750 + NumberOfSlices: 43 + NumberofMeasurements: 300 + ParallelAcquisition: 'Yes' + ParallelAcquisitionTechnique: ASSET + PhaseEncodingDirection: j- + PixelBandwidth: 3437.5 + PixelSpacing: 3.4x3.4 + PlaneOrientationSequence: Axial + PulseSequenceType: EPI + ReceiveCoilName: 8 Chan + ReceiveCoilType: Head + RepetitionTime: 2.0 + ScanOptions: FS + SliceAcquisitionOrder: Interleaved Ascending + SliceEncodingDirection: k + SliceThickness: 3.4 + SliceTiming: + - 0.0 + - 1023.26 + - 46.51 + - 1069.77 + - 93.02 + - 1116.28 + - 139.53 + - 1162.79 + - 186.05 + - 1209.3 + - 232.56 + - 1255.81 + - 279.07 + - 1302.33 + - 325.58 + - 1348.84 + - 372.09 + - 1395.35 + - 418.6 + - 1441.86 + - 465.12 + - 1488.37 + - 511.63 + - 1534.88 + - 558.14 + - 1581.4 + - 604.65 + - 1627.91 + - 651.16 + - 1674.42 + - 697.67 + - 1720.93 + - 744.19 + - 1767.44 + - 790.7 + - 1813.95 + - 837.21 + - 1860.47 + - 883.72 + - 1906.98 + - 930.23 + - 1953.49 + - 976.74 + SpacingBetweenSlices: 3.4 + TaskDescription: ' During functional scanning, subjects were presented with + a fixation cross and were instructed to keep their eyes open, relax and + move as little as possible while observing the fixation cross. Subjects + were also instructed not to engage in breath counting or meditation.' + TaskName: rest + site_id: HNU_1 + subject_id: sub-0025448 + unique_id: ses-1 diff --git a/data_config_regtest_quick.yml b/data_config_regtest_quick.yml index 44d0739..e7a865d 100644 --- a/data_config_regtest_quick.yml +++ b/data_config_regtest_quick.yml @@ -1,13 +1,6 @@ -# CPAC Data Configuration File -# Version 1.4.3 -# -# http://fcp-indi.github.io for more info. -# -# Tip: This file can be edited manually with a text editor for quick modifications. - - # ADHD200 data -# for a large number of participants for group-level analyses +# # for a large number of participants for group-level analyses + - anat: s3://fcp-indi/data/Projects/ADHD200/RawDataBIDS/KKI/sub-1019436/ses-1/anat/sub-1019436_ses-1_run-1_T1w.nii.gz func: rest_acq-1_run-1: @@ -64,4 +57,4 @@ scan_parameters: s3://fcp-indi/data/Projects/RocklandSample/RawDataBIDS/task-MSIT_bold.json site: NKI subject_id: A00028352 - unique_id: NFB3 \ No newline at end of file + unique_id: NFB3 diff --git a/run_cpac.sh b/run_cpac.sh new file mode 100755 index 0000000..db30d6b --- /dev/null +++ b/run_cpac.sh @@ -0,0 +1,163 @@ +#!/bin/bash + +# usage +# > ./run_cpac_container.sh {docker tag} {name} {data} {pipeline} {participant_ndx} {mode} +# /\ optional + +# {mode} options: +# (leave this blank to simply run C-PAC) +# - enter = enter the container instead of running C-PAC +# - current = use C-PAC install from code in current branch of C-PAC repo listed in "repo" +# - enter-current = enter the container instead of running, with C-PAC install from code +# in current branch of C-PAC repo listed in "repo" +# - pre-182 = don't use '--num_ants_threads' +# - pre-182-current + +docker_image=$1 +run_name=$2 +data=$3 +pipe=$4 +aux=$5 +mode=$6 + +# Custom args for this run +#------------------------- +# Paths +repo="/media/ebs/C-PAC" + +# Run settings +n_cpus=30 +ants_cpus=15 +mem_gb=45 + +# Automated args +#------------------------- +# Data +if [[ "${data}" == *".yml" || "${data}" == *".yaml" ]] +then + data_config="${data}" + bids_dir=/home/ubuntu # keep as /home/ubuntu when providing a data_config +else + bids_dir="${data}" +fi + +if [[ "${pipe}" == "default" ]] +then + pipe_config="" + preconfig="" +elif [[ "${pipe}" == *".yml" || "${pipe}" == *".yaml" ]] +then + pipe_config="${pipe}" + pipe_name="" +else + # a preconfig name was given instead - this will be appended to {name} + preconfig="${pipe}" + pipe_name="_${pipe}" +fi + +# Pipeline +run_name="${run_name}${pipe_name}" +#------------------------- + +if [[ -z "$data_config" ]] +then + data_map="-v /tmp:/tmp" + data_config="" +else + data_map="-v $data_config:/configs/data_config.yml" + data_config="--data_config_file /configs/data_config.yml" +fi + +if [[ -z "$bids_dir" ]] +then + bids_map="-v /tmp:/tmp" + bids_dir="/home/ubuntu" +else + bids_map="-v $bids_dir:$bids_dir" +fi + +if [[ -z "$pipe_config" ]] +then + pipe_map="-v /tmp:/tmp" + pipe_config="" +else + pipe_map="-v $pipe_config:/configs/pipe_config.yml" + pipe_config="--pipeline_file /configs/pipe_config.yml" +fi + +if [[ "$preconfig" ]] +then + pipe_config="--preconfig $preconfig" +fi + +configs="${data_config} ${pipe_config}" + +if [[ $mode != "pre-182" && $mode != "pre-182-current" ]] +then + configs="${configs} --num_ants_threads ${ants_cpus}" +fi + +if [[ -n $aux && $aux != "all" ]] +then + configs="${configs} --participant_ndx ${aux}" +fi + +if [[ $mode = "enter" ]] +then + sudo docker run -it \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs:/media/ebs \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + --entrypoint bash \ + $docker_image +elif [[ $mode = "enter-current" ]] +then + sudo docker run -it \ + -v $repo/CPAC:/code/CPAC \ + -v $repo/dev/docker_data/run.py:/code/run.py \ + -v $repo/dev/docker_data:/cpac_resources \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs:/media/ebs \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $bids_map \ + $data_map \ + $pipe_map \ + --entrypoint bash \ + $docker_image +elif [[ $mode = "current" ]] +then + sudo docker run \ + -v $repo/CPAC:/code/CPAC \ + -v $repo/dev/docker_data/run.py:/code/run.py \ + -v $repo/dev/docker_data:/cpac_resources \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs:/media/ebs \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $bids_map \ + $data_map \ + $pipe_map \ + $docker_image $bids_dir /output participant \ + --save_working_dir \ + --skip_bids_validator \ + --n_cpus $n_cpus \ + --mem_gb $mem_gb \ + $configs +else + sudo docker run \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs:/media/ebs \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $bids_map \ + $data_map \ + $pipe_map \ + $docker_image $bids_dir /output participant \ + --save_working_dir \ + --skip_bids_validator \ + --n_cpus $n_cpus \ + --mem_gb $mem_gb \ + $configs +fi diff --git a/run_cpac_container_default.sh b/run_cpac_container_default.sh new file mode 100755 index 0000000..8f30576 --- /dev/null +++ b/run_cpac_container_default.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +# usage +# > ./run_cpac_container.sh {docker tag} {run label} {mode} +# /\ optional + +# {mode} options: +# (leave this blank to simply run C-PAC) +# - enter = enter the container instead of running C-PAC +# - current = use C-PAC install from code in current branch of C-PAC repo listed in "repo" +# - enter-current = enter the container instead of running, with C-PAC install from code +# in current branch of C-PAC repo listed in "repo" + +docker_image=$1 +name=$2 +mode=$3 + +if [[ -z "$name" ]] +then + name="test" +fi + +# Custom args for this run +#------------------------- +# Paths +run_name="${name}_default" +repo="/media/ebs/C-PAC" + +# Data +data_config="/media/ebs/CPAC_regtest_pack/data_config_regtest_quick_incomplete.yml" + +bids_dir=/home/ubuntu # keep as /home/ubuntu when providing a data_config +#bids_dir="s3://fcp-indi/data/Projects/HBN/MRI/Site-CBIC" +#bids_dir="s3://fcp-indi/data/Projects/CORR/RawDataBIDS/HNU_1" + +# Pipeline +#pipe_config="/media/ebs/runs/configs/pipeline_config_regtest-4.yml" +#preconfig="benchmark-ANTS" # preconfig will override pipe_config + + +# Run settings +cpu_max=8 +n_cpus=8 +ants_cpus=4 +mem_gb=15 +#------------------------- + +if [[ -z "$data_config" ]] +then + # if bids_dir = an S3 path, can't do the mapping below + #data_map="-v $bids_dir:$bids_dir" + data_map="-v /tmp:/tmp" + data_config="" +else + data_map="-v $data_config:/configs/data_config.yml" + data_config="--data_config_file /configs/data_config.yml" +fi + +if [[ -z "$pipe_config" ]] +then + pipe_map="-v /tmp:/tmp" + pipe_config="" +else + pipe_map="-v $pipe_config:/configs/pipe_config.yml" + pipe_config="--pipeline_file /configs/pipe_config.yml" +fi + +if [[ "$preconfig" ]] +then + pipe_config="--preconfig $preconfig" +fi + + +if [[ $mode = "enter" ]] +then + sudo docker run -it \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + --entrypoint bash \ + $docker_image +elif [[ $mode = "enter-current" ]] +then + sudo docker run -it \ + -v $repo/CPAC:/code/CPAC \ + -v $repo/dev/docker_data/run.py:/code/run.py \ + -v $repo/dev/docker_data:/cpac_resources \ + -v $repo/dev/docker_data/bids_utils.py:/code/bids_utils.py \ + -v $repo/dev/docker_data/default_pipeline.yml:/code/default_pipeline.yml \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + --entrypoint bash \ + $docker_image +elif [[ $mode = "current" ]] +then + sudo docker run \ + -v $repo/CPAC:/code/CPAC \ + -v $repo/dev/docker_data/run.py:/code/run.py \ + -v $repo/dev/docker_data:/cpac_resources \ + -v $repo/dev/docker_data/bids_utils.py:/code/bids_utils.py \ + -v $repo/dev/docker_data/default_pipeline.yml:/code/default_pipeline.yml \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $data_map \ + $pipe_map \ + $docker_image $bids_dir /output participant \ + --save_working_dir \ + --skip_bids_validator \ + --n_cpus $cpu_max \ + --num_ants_threads $ants_cpus \ + --mem_gb $mem_gb \ + $data_config \ + $pipe_config +else + sudo docker run \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $data_map \ + $pipe_map \ + $docker_image $bids_dir /output participant \ + --save_working_dir \ + --skip_bids_validator \ + --n_cpus $cpu_max \ + --num_ants_threads $ants_cpus \ + --mem_gb $mem_gb \ + $data_config \ + $pipe_config +fi diff --git a/run_cpac_container_fmriprep-options.sh b/run_cpac_container_fmriprep-options.sh new file mode 100755 index 0000000..fbd905f --- /dev/null +++ b/run_cpac_container_fmriprep-options.sh @@ -0,0 +1,126 @@ +#!/bin/bash + +# usage +# > ./run_cpac_container.sh {docker tag} {run label} {mode} +# /\ optional + +# {mode} options: +# (leave this blank to simply run C-PAC) +# - enter = enter the container instead of running C-PAC +# - current = use C-PAC install from code in current branch of C-PAC repo listed in "repo" +# - enter-current = enter the container instead of running, with C-PAC install from code +# in current branch of C-PAC repo listed in "repo" + +docker_image=$1 +name=$2 +mode=$3 + +if [[ -z "$name" ]] +then + name="test" +fi + +# Custom args for this run +#------------------------- +# Paths +run_name="${name}_fmriprep-options" +repo="/media/ebs/C-PAC" + +# Data +data_config="/media/ebs/CPAC_regtest_pack/data_config_regtest_quick_incomplete.yml" + +bids_dir=/home/ubuntu # keep as /home/ubuntu when providing a data_config +#bids_dir="s3://fcp-indi/data/etc." + +# Pipeline +pipe_config="/media/ebs/runs/configs/pipe_fmriprep-opts_antsmult.yml" +#preconfig="fmriprep-options" # preconfig will override pipe_config + + +# Run settings +cpu_max=16 +n_cpus=16 +ants_cpus=10 +mem_gb=20 +#------------------------- + +if [[ -z "$data_config" ]] +then + data_map="-v $bids_dir:$bids_dir" + data_config="" +else + data_map="-v $data_config:/configs/data_config.yml" + data_config="--data_config_file /configs/data_config.yml" +fi + +if [[ -z "$pipe_config" ]] +then + pipe_map="-v /tmp:/tmp" + pipe_config="" +else + pipe_map="-v $pipe_config:/configs/pipe_config.yml" + pipe_config="--pipeline_file /configs/pipe_config.yml" +fi + +if [[ "$preconfig" ]] +then + pipe_config="--preconfig $preconfig" +fi + + +if [[ $mode = "enter" ]] +then + sudo docker run -it \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + --entrypoint bash \ + $docker_image +elif [[ $mode = "enter-current" ]] +then + sudo docker run -it \ + -v $repo/CPAC:/code/CPAC \ + -v $repo/dev/docker_data/run.py:/code/run.py \ + -v $repo/dev/docker_data:/cpac_resources \ + -v $repo/dev/docker_data/bids_utils.py:/code/bids_utils.py \ + -v $repo/dev/docker_data/default_pipeline.yml:/code/default_pipeline.yml \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + --entrypoint bash \ + $docker_image +elif [[ $mode = "current" ]] +then + sudo docker run \ + -v $repo/CPAC:/code/CPAC \ + -v $repo/dev/docker_data/run.py:/code/run.py \ + -v $repo/dev/docker_data:/cpac_resources \ + -v $repo/dev/docker_data/bids_utils.py:/code/bids_utils.py \ + -v $repo/dev/docker_data/default_pipeline.yml:/code/default_pipeline.yml \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $data_map \ + $pipe_map \ + $docker_image $bids_dir /output participant \ + --save_working_dir \ + --skip_bids_validator \ + --n_cpus $cpu_max \ + --mem_gb $mem_gb \ + $data_config \ + $pipe_config +else + sudo docker run \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $data_map \ + $pipe_map \ + $docker_image $bids_dir /output participant \ + --save_working_dir \ + --skip_bids_validator \ + --n_cpus $cpu_max \ + --mem_gb $mem_gb \ + $data_config \ + $pipe_config +fi diff --git a/run_cpac_container_preproc.sh b/run_cpac_container_preproc.sh new file mode 100755 index 0000000..5368200 --- /dev/null +++ b/run_cpac_container_preproc.sh @@ -0,0 +1,126 @@ +#!/bin/bash + +# usage +# > ./run_cpac_container.sh {docker tag} {mode} +# /\ optional + +# {mode} options: +# (leave this blank to simply run C-PAC) +# - enter = enter the container instead of running C-PAC +# - current = use C-PAC install from code in current branch of C-PAC repo listed in "repo" +# - enter-current = enter the container instead of running, with C-PAC install from code +# in current branch of C-PAC repo listed in "repo" + +docker_image=$1 +mode=$2 + +# Custom args for this run +#------------------------- +# Paths +run_name="v170_preproc" +repo="/media/ebs/C-PAC" + +# Data +data_config="/media/ebs/CPAC_regtest_pack/cpac_data_config_regtest.yml" + +bids_dir=/home/ubuntu # keep as /home/ubuntu when providing a data_config +#bids_dir="s3://fcp-indi/data/etc." + +# Pipeline +#pipe_config="/media/ebs/CPAC_regtest_pack/configs/cpac_pipeline_config_default-no-deriv.yml" +preconfig="preproc" # preconfig will override pipe_config + + +# Run settings +n_cpus=6 +ants_cpus=3 +mem_gb=30 +num_subs=5 +#------------------------- + +if [[ -z "$data_config" ]] +then + data_map="-v /tmp:/tmp" + data_config="--pipeline_override ''" +else + data_map="-v $data_config:/configs/data_config.yml" + data_config="--data_config_file /configs/data_config.yml" +fi + +if [[ -z "$pipe_config" ]] +then + pipe_map="-v /tmp:/tmp" + pipe_config="--pipeline_override ''" +else + pipe_map="-v $pipe_config:/configs/pipe_config.yml" + pipe_config="--pipeline_file /configs/pipe_config.yml" +fi + +if [[ "$preconfig" ]] +then + pipe_config="--preconfig $preconfig" +fi + + +if [[ $mode = "enter" ]] +then + sudo docker run -it \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + --entrypoint bash \ + $docker_image +elif [[ $mode = "enter-current" ]] +then + sudo docker run -it \ + -v $repo/CPAC:/code/CPAC \ + -v $repo/dev/docker_data/run.py:/code/run.py \ + -v $repo/dev/docker_data:/cpac_resources \ + -v $repo/dev/docker_data/bids_utils.py:/code/bids_utils.py \ + -v $repo/dev/docker_data/default_pipeline.yml:/code/default_pipeline.yml \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + --entrypoint bash \ + $docker_image +elif [[ $mode = "current" ]] +then + sudo docker run \ + -v $repo/CPAC:/code/CPAC \ + -v $repo/dev/docker_data/run.py:/code/run.py \ + -v $repo/dev/docker_data:/cpac_resources \ + -v $repo/dev/docker_data/bids_utils.py:/code/bids_utils.py \ + -v $repo/dev/docker_data/default_pipeline.yml:/code/default_pipeline.yml \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $data_map \ + $pipe_map \ + $docker_image $bids_dir /output participant \ + --save_working_dir \ + --skip_bids_validator \ + $data_config \ + $pipe_config \ + --n_cpus $n_cpus \ + --mem_gb $mem_gb \ + --pipeline_override "num_ants_threads: $ants_cpus" \ + --pipeline_override "numParticipantsAtOnce: $num_subs" \ + --pipeline_override "maxCoresPerParticipant: $n_cpus" +else + sudo docker run \ + -v /home/ubuntu:/home/ubuntu \ + -v /media/ebs/CPAC_regtest_pack:/media/ebs/CPAC_regtest_pack \ + -v /media/ebs/runs/$run_name:/output \ + $data_map \ + $pipe_map \ + $docker_image $bids_dir /output participant \ + --save_working_dir \ + --skip_bids_validator \ + $data_config \ + $pipe_config \ + --n_cpus $n_cpus \ + --mem_gb $mem_gb \ + --pipeline_override "num_ants_threads: $ants_cpus" \ + --pipeline_override "numParticipantsAtOnce: $num_subs" \ + --pipeline_override "maxCoresPerParticipant: $n_cpus" +fi