|
| 1 | +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT |
| 2 | +from __future__ import unicode_literals |
| 3 | +from ..em import EM |
| 4 | + |
| 5 | + |
| 6 | +def test_EM_inputs(): |
| 7 | + input_map = dict(args=dict(argstr='%s', |
| 8 | + ), |
| 9 | + bc_order_val=dict(argstr='-bc_order %s', |
| 10 | + ), |
| 11 | + bc_thresh_val=dict(argstr='-bc_thresh %s', |
| 12 | + ), |
| 13 | + environ=dict(nohash=True, |
| 14 | + usedefault=True, |
| 15 | + ), |
| 16 | + ignore_exception=dict(nohash=True, |
| 17 | + usedefault=True, |
| 18 | + ), |
| 19 | + in_file=dict(argstr='-in %s', |
| 20 | + mandatory=True, |
| 21 | + position=4, |
| 22 | + ), |
| 23 | + mask_file=dict(argstr='-mask %s', |
| 24 | + ), |
| 25 | + max_iter=dict(argstr='-max_iter %s', |
| 26 | + ), |
| 27 | + min_iter=dict(argstr='-min_iter %s', |
| 28 | + ), |
| 29 | + mrf_beta_val=dict(argstr='-mrf_beta %s', |
| 30 | + ), |
| 31 | + no_prior=dict(argstr='-nopriors %s', |
| 32 | + mandatory=True, |
| 33 | + xor=['prior_4D', 'priors'], |
| 34 | + ), |
| 35 | + out_bc_file=dict(argstr='-bc_out %s', |
| 36 | + name_source=['in_file'], |
| 37 | + name_template='%s_bc_em.nii.gz', |
| 38 | + ), |
| 39 | + out_file=dict(argstr='-out %s', |
| 40 | + name_source=['in_file'], |
| 41 | + name_template='%s_em.nii.gz', |
| 42 | + ), |
| 43 | + out_outlier_file=dict(argstr='-out_outlier %s', |
| 44 | + name_source=['in_file'], |
| 45 | + name_template='%s_outlier_em.nii.gz', |
| 46 | + ), |
| 47 | + outlier_val=dict(argstr='-outlier %s %s', |
| 48 | + ), |
| 49 | + prior_4D=dict(argstr='-prior4D %s', |
| 50 | + mandatory=True, |
| 51 | + xor=['no_prior', 'priors'], |
| 52 | + ), |
| 53 | + priors=dict(argstr='%s', |
| 54 | + mandatory=True, |
| 55 | + xor=['no_prior', 'prior_4D'], |
| 56 | + ), |
| 57 | + reg_val=dict(argstr='-reg %s', |
| 58 | + ), |
| 59 | + relax_priors=dict(argstr='-rf %s %s', |
| 60 | + ), |
| 61 | + terminal_output=dict(nohash=True, |
| 62 | + ), |
| 63 | + ) |
| 64 | + inputs = EM.input_spec() |
| 65 | + |
| 66 | + for key, metadata in list(input_map.items()): |
| 67 | + for metakey, value in list(metadata.items()): |
| 68 | + assert getattr(inputs.traits()[key], metakey) == value |
| 69 | + |
| 70 | + |
| 71 | +def test_EM_outputs(): |
| 72 | + output_map = dict(out_bc_file=dict(), |
| 73 | + out_file=dict(), |
| 74 | + out_outlier_file=dict(), |
| 75 | + ) |
| 76 | + outputs = EM.output_spec() |
| 77 | + |
| 78 | + for key, metadata in list(output_map.items()): |
| 79 | + for metakey, value in list(metadata.items()): |
| 80 | + assert getattr(outputs.traits()[key], metakey) == value |
0 commit comments