# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..preprocess import Segment


def test_Segment_inputs():
    input_map = dict(affine_regularization=dict(field='opts.regtype',
    ),
    bias_fwhm=dict(field='opts.biasfwhm',
    ),
    bias_regularization=dict(field='opts.biasreg',
    ),
    clean_masks=dict(field='output.cleanup',
    ),
    csf_output_type=dict(field='output.CSF',
    ),
    data=dict(copyfile=False,
    field='data',
    mandatory=True,
    ),
    gaussians_per_class=dict(field='opts.ngaus',
    ),
    gm_output_type=dict(field='output.GM',
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    mask_image=dict(field='opts.msk',
    ),
    matlab_cmd=dict(),
    mfile=dict(usedefault=True,
    ),
    paths=dict(),
    sampling_distance=dict(field='opts.samp',
    ),
    save_bias_corrected=dict(field='output.biascor',
    ),
    tissue_prob_maps=dict(field='opts.tpm',
    ),
    use_mcr=dict(),
    use_v8struct=dict(min_ver='8',
    usedefault=True,
    ),
    warp_frequency_cutoff=dict(field='opts.warpco',
    ),
    warping_regularization=dict(field='opts.warpreg',
    ),
    wm_output_type=dict(field='output.WM',
    ),
    )
    inputs = Segment.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            yield assert_equal, getattr(inputs.traits()[key], metakey), value


def test_Segment_outputs():
    output_map = dict(bias_corrected_image=dict(),
    inverse_transformation_mat=dict(),
    modulated_csf_image=dict(),
    modulated_gm_image=dict(),
    modulated_input_image=dict(deprecated='0.10',
    new_name='bias_corrected_image',
    ),
    modulated_wm_image=dict(),
    native_csf_image=dict(),
    native_gm_image=dict(),
    native_wm_image=dict(),
    normalized_csf_image=dict(),
    normalized_gm_image=dict(),
    normalized_wm_image=dict(),
    transformation_mat=dict(),
    )
    outputs = Segment.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            yield assert_equal, getattr(outputs.traits()[key], metakey), value
