# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
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",
        ),
        mask_image=dict(
            extensions=None,
            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()):
            assert getattr(inputs.traits()[key], metakey) == value


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

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