return [experiment] + np.mean(results, axis=0).tolist() if __name__ == "__main__": reset() arguments = docopt(__doc__) pd.set_option("display.expand_frame_repr", False) pheno_path = "./data/phenotypes/Phenotypic_V1_0b_preprocessed949.csv" pheno = load_phenotypes(pheno_path) hdf5 = hdf5_handler("./data/abide_cc200_tichu.hdf5", "a") valid_derivatives = ["cc200", "aal", "ez", "ho", "tt", "dosenbach160"] derivatives = [ derivative for derivative in arguments["<derivative>"] if derivative in valid_derivatives ] experiments = [] for derivative in derivatives: config = {"derivative": derivative} if arguments["--whole"]: experiments += [format_config("{derivative}_whole", config)],
help='folder containing the stim times') #----------------------------------------------------------------------------------------------- args = parser.parse_args() visits = ['visit1','visit2']#args.nifti_folder in_rois = args.in_rois subjects_ids_csv = args.subjects_ids output_file = args.output_file nifti_type = args.nifti_type stims_folder = args.stims_folder if not isinstance(visits,list): visits = [visits] # Instance output file output_file = hdf5_handler(output_file,'a') # Load clinical data subjects_ids = pd.read_csv(subjects_ids_csv,header=None) # Create roi and correlation object masker = NiftiLabelsMasker(labels_img=in_rois, standardize=True) correlation_measure = ConnectivityMeasure(kind='correlation') ids_nifts = subjects_ids.values.astype(str) # ids_nifts = ids_nifts[ids_nifts != 'nan'] for visit in visits: if nifti_type == 'errts': nifti_files = glob.glob('../'+visit+'/*+tlrc.BRIK')
patient_storage.attrs["sex"] = record["SEX"] patient_storage.create_dataset(derivative, data=func_data[pid]) if __name__ == "__main__": random.seed(19) np.random.seed(19) arguments = docopt(__doc__) folds = int(arguments["--folds"]) pheno_path = "./data/phenotypes/Phenotypic_V1_0b_preprocessed949.csv" pheno = load_phenotypes(pheno_path) hdf5 = hdf5_handler("./data/abide_aal_tichu.hdf5", "a") #hdf5 = hdf5_handler("./data/abide_cc200_tichu.hdf5", "a") #hdf5 = hdf5_handler("./data/abide_dosenbach160_tichu.hdf5", "a") valid_derivatives = ["cc200", "aal", "ez", "ho", "tt", "dosenbach160"] derivatives = [ derivative for derivative in arguments["<derivative>"] if derivative in valid_derivatives ] if "patients" not in hdf5: load_patients_to_file(hdf5, pheno, derivatives) if arguments["--whole"]: print print "Preparing whole dataset"
prev_model_2_path=ae2_model_path, code_size_1=code_size_1, code_size_2=code_size_2) if __name__ == "__main__": reset() arguments = docopt(__doc__) pheno_path = "./data/phenotypes/Phenotypic_V1_0b_preprocessed1.csv" pheno = load_phenotypes(pheno_path) # hdf5 = hdf5_handler("./data/abide.hdf5", "a") hdf5 = hdf5_handler(bytes("./data/abide.hdf5", encoding="utf8"), 'a') valid_derivatives = ["cc200", "aal", "ez", "ho", "tt", "dosenbach160"] derivatives = [ derivative for derivative in arguments["<derivative>"] if derivative in valid_derivatives ] experiments = [] for derivative in derivatives: config = {"derivative": derivative} if arguments["--whole"]: experiments += [format_config("{derivative}_whole", config)],
patient_storage.attrs["sex"] = record["SEX"] patient_storage.create_dataset(derivative, data=func_data[pid]) if __name__ == "__main__": random.seed(19) np.random.seed(19) arguments = docopt(__doc__) folds = int(arguments["--folds"]) pheno_path = "./data/phenotypes/Phenotypic_V1_0b_preprocessed1.csv" pheno = load_phenotypes(pheno_path) hdf5 = hdf5_handler("./data/abide.hdf5", "a") valid_derivatives = ["cc200", "aal", "ez", "ho", "tt", "dosenbach160"] derivatives = [ derivative for derivative in arguments["<derivative>"] if derivative in valid_derivatives ] if "patients" not in hdf5: load_patients_to_file(hdf5, pheno, derivatives) if arguments["--whole"]: print print "Preparing whole dataset" prepare_folds(hdf5, folds,