help='Prefix used in the result files') arg_parser.add_argument('--hemi', default='', choices=HEMI_CHOICE, help='Mandatory for surface-based analysis.') arguments = arg_parser.parse_args() config_file = arguments.configuration_file categories = arguments.categories parameters = arguments.parameters prefix = arguments.prefix hemi = HEMI_CHOICE[arguments.hemi] """ LOAD DATA USING DATALOADER """ subjects, covariate_names, covariates, processing_parameters, affine_matrix, output_dir, \ results_io, type_data = helper_functions.load_data_from_config_file(config_file) if type_data == 'surf': if hemi == '': raise ValueError( 'Please, specify the hemisphere for surface-based analysis. See arguments.' ) if parameters: # Load user defined parameters try: parameters_path = path.normpath(path.join(output_dir, parameters)) with open(parameters_path, 'rb') as f: udp = eval(f.read()) print() print('User defined parameters have been successfully loaded.') except IOError as ioe:
arguments = arguments_parser.parse_args() config_file = arguments.configuration_file method = arguments.method method_func = METHOD_CHOICES[method] dirs = arguments.dirs cluster_size = arguments.cluster_size p_thresholds = arguments.p_thresholds gamma = arguments.gamma percentile_filter = arguments.percentile_filter gm_threshold = arguments.gm_threshold labels = arguments.labels hemi = HEMI_CHOICE[arguments.hemi] """ LOAD DATA USING DATALOADER """ subjects, covariate_names, covariates, processing_parameters, \ affine_matrix, output_dir, results_io, type_data = helper_functions.load_data_from_config_file(config_file) if type_data == 'surf': if hemi == '': raise ValueError( 'Please, specify the hemisphere for surface-based analysis. See arguments.' ) """ LOAD RESULTS DATA """ if dirs is None: # Find prediction parameters inside results folder pathname = path.join(output_dir, '**', hemi + '*prediction_parameters.mha') print(pathname) for p in glob(pathname): n, category, pred_p, corr_p, proc = helper_functions.get_results_from_path( p, results_io, subjects, covariate_names, covariates,