def test_build_matrix(self): input_headers = ['xsitype', 'quality', 'type', 'files'] input_xsitype = ['xnat:mrScanData'] input_quality = ['unusable', 'usable', 'preferred'] input_type = ['T1', 'T2'] input_files = [ [], [('NIFTI', ['images.nii'])], # [('NIFTI', ['images.nii']), ('SNAPSHOTS', ['snapshot.jpg.gz', # 'snapshot(1).jpg.gz'])] ] input_values = [input_xsitype, input_quality, input_type, input_files] input_table_values = itertools.product(*input_values) input_table = [[dict(zip(input_headers, r))] for r in input_table_values] headers = ['required', 'select', 'quality', 'inputs'] required = [None, False, True] select = [None, 'foreach'] quality = [None, False, True] input_fields = [[]] + [i for i in input_table] values = [required, select, quality, input_fields] table_values = itertools.product(*values) table = [dict(zip(headers, r)) for r in table_values] # generate the scan artefacts against which this is run for scans in input_table: for scan in scans: SessionTools.add_scan(None, 'scan1', scan) print((len(table)))
def test_build_matrix(self): input_headers = ['xsitype', 'quality', 'type', 'files'] input_xsitype = ['xnat:mrScanData'] input_quality = ['unusable', 'usable', 'preferred'] input_type = ['T1', 'T2'] input_files = [ [], [('NIFTI', ['images.nii'])], #[('NIFTI', ['images.nii']), ('SNAPSHOTS', ['snapshot.jpg.gz', 'snapshot(1).jpg.gz'])] ] input_values = [input_xsitype, input_quality, input_type, input_files] input_table_values = itertools.product(*input_values) input_table = map(lambda r: [dict(itertools.izip(input_headers, r))], input_table_values) headers = ['required', 'select', 'quality', 'inputs'] required = [None, False, True] select = [None, 'foreach'] quality = [None, False, True] input_fields = [[]] + [i for i in input_table] values = [required, select, quality, input_fields] table_values = itertools.product(*values) table = map(lambda r: dict(itertools.izip(headers, r)), table_values) # generate the scan artefacts against which this is run for scans in input_table: for scan in scans: SessionTools.add_scan(None, 'scan1', scan) print len(table)
def _setup_scans(session, scan_descriptors): for s, d in scan_descriptors: print((s, d)) SessionTools.add_scan(session, s, scan_presets[d])
def _setup_scans(session, scan_descriptors): for s, d in scan_descriptors: print(s, d) SessionTools.add_scan(session, s, scan_presets[d])