# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..minc import Resample


def test_Resample_inputs():
    input_map = dict(
        args=dict(argstr="%s",),
        clobber=dict(argstr="-clobber", usedefault=True,),
        coronal_slices=dict(
            argstr="-coronal", xor=("transverse", "sagittal", "coronal"),
        ),
        dircos=dict(
            argstr="-dircos %s %s %s", xor=("nelements", "nelements_x_y_or_z"),
        ),
        environ=dict(nohash=True, usedefault=True,),
        fill=dict(argstr="-fill", xor=("nofill", "fill"),),
        fill_value=dict(argstr="-fillvalue %s", requires=["fill"],),
        format_byte=dict(
            argstr="-byte",
            xor=(
                "format_byte",
                "format_short",
                "format_int",
                "format_long",
                "format_float",
                "format_double",
                "format_signed",
                "format_unsigned",
            ),
        ),
        format_double=dict(
            argstr="-double",
            xor=(
                "format_byte",
                "format_short",
                "format_int",
                "format_long",
                "format_float",
                "format_double",
                "format_signed",
                "format_unsigned",
            ),
        ),
        format_float=dict(
            argstr="-float",
            xor=(
                "format_byte",
                "format_short",
                "format_int",
                "format_long",
                "format_float",
                "format_double",
                "format_signed",
                "format_unsigned",
            ),
        ),
        format_int=dict(
            argstr="-int",
            xor=(
                "format_byte",
                "format_short",
                "format_int",
                "format_long",
                "format_float",
                "format_double",
                "format_signed",
                "format_unsigned",
            ),
        ),
        format_long=dict(
            argstr="-long",
            xor=(
                "format_byte",
                "format_short",
                "format_int",
                "format_long",
                "format_float",
                "format_double",
                "format_signed",
                "format_unsigned",
            ),
        ),
        format_short=dict(
            argstr="-short",
            xor=(
                "format_byte",
                "format_short",
                "format_int",
                "format_long",
                "format_float",
                "format_double",
                "format_signed",
                "format_unsigned",
            ),
        ),
        format_signed=dict(
            argstr="-signed",
            xor=(
                "format_byte",
                "format_short",
                "format_int",
                "format_long",
                "format_float",
                "format_double",
                "format_signed",
                "format_unsigned",
            ),
        ),
        format_unsigned=dict(
            argstr="-unsigned",
            xor=(
                "format_byte",
                "format_short",
                "format_int",
                "format_long",
                "format_float",
                "format_double",
                "format_signed",
                "format_unsigned",
            ),
        ),
        half_width_sinc_window=dict(
            argstr="-width %s", requires=["sinc_interpolation"],
        ),
        input_file=dict(argstr="%s", extensions=None, mandatory=True, position=-2,),
        input_grid_files=dict(),
        invert_transformation=dict(argstr="-invert_transformation",),
        keep_real_range=dict(
            argstr="-keep_real_range", xor=("keep_real_range", "nokeep_real_range"),
        ),
        like=dict(argstr="-like %s", extensions=None,),
        nearest_neighbour_interpolation=dict(
            argstr="-nearest_neighbour",
            xor=(
                "trilinear_interpolation",
                "tricubic_interpolation",
                "nearest_neighbour_interpolation",
                "sinc_interpolation",
            ),
        ),
        nelements=dict(
            argstr="-nelements %s %s %s", xor=("nelements", "nelements_x_y_or_z"),
        ),
        no_fill=dict(argstr="-nofill", xor=("nofill", "fill"),),
        no_input_sampling=dict(
            argstr="-use_input_sampling", xor=("vio_transform", "no_input_sampling"),
        ),
        nokeep_real_range=dict(
            argstr="-nokeep_real_range", xor=("keep_real_range", "nokeep_real_range"),
        ),
        origin=dict(argstr="-origin %s %s %s",),
        output_file=dict(
            argstr="%s",
            extensions=None,
            genfile=True,
            hash_files=False,
            name_source=["input_file"],
            name_template="%s_resample.mnc",
            position=-1,
        ),
        output_range=dict(argstr="-range %s %s",),
        sagittal_slices=dict(
            argstr="-sagittal", xor=("transverse", "sagittal", "coronal"),
        ),
        sinc_interpolation=dict(
            argstr="-sinc",
            xor=(
                "trilinear_interpolation",
                "tricubic_interpolation",
                "nearest_neighbour_interpolation",
                "sinc_interpolation",
            ),
        ),
        sinc_window_hamming=dict(
            argstr="-hamming",
            requires=["sinc_interpolation"],
            xor=("sinc_window_hanning", "sinc_window_hamming"),
        ),
        sinc_window_hanning=dict(
            argstr="-hanning",
            requires=["sinc_interpolation"],
            xor=("sinc_window_hanning", "sinc_window_hamming"),
        ),
        spacetype=dict(argstr="-spacetype %s",),
        standard_sampling=dict(argstr="-standard_sampling",),
        start=dict(argstr="-start %s %s %s", xor=("nelements", "nelements_x_y_or_z"),),
        step=dict(argstr="-step %s %s %s", xor=("nelements", "nelements_x_y_or_z"),),
        talairach=dict(argstr="-talairach",),
        transformation=dict(argstr="-transformation %s", extensions=None,),
        transverse_slices=dict(
            argstr="-transverse", xor=("transverse", "sagittal", "coronal"),
        ),
        tricubic_interpolation=dict(
            argstr="-tricubic",
            xor=(
                "trilinear_interpolation",
                "tricubic_interpolation",
                "nearest_neighbour_interpolation",
                "sinc_interpolation",
            ),
        ),
        trilinear_interpolation=dict(
            argstr="-trilinear",
            xor=(
                "trilinear_interpolation",
                "tricubic_interpolation",
                "nearest_neighbour_interpolation",
                "sinc_interpolation",
            ),
        ),
        two=dict(argstr="-2",),
        units=dict(argstr="-units %s",),
        vio_transform=dict(
            argstr="-tfm_input_sampling", xor=("vio_transform", "no_input_sampling"),
        ),
        xdircos=dict(
            argstr="-xdircos %s",
            requires=("ydircos", "zdircos"),
            xor=("dircos", "dircos_x_y_or_z"),
        ),
        xnelements=dict(
            argstr="-xnelements %s",
            requires=("ynelements", "znelements"),
            xor=("nelements", "nelements_x_y_or_z"),
        ),
        xstart=dict(
            argstr="-xstart %s",
            requires=("ystart", "zstart"),
            xor=("start", "start_x_y_or_z"),
        ),
        xstep=dict(
            argstr="-xstep %s",
            requires=("ystep", "zstep"),
            xor=("step", "step_x_y_or_z"),
        ),
        ydircos=dict(
            argstr="-ydircos %s",
            requires=("xdircos", "zdircos"),
            xor=("dircos", "dircos_x_y_or_z"),
        ),
        ynelements=dict(
            argstr="-ynelements %s",
            requires=("xnelements", "znelements"),
            xor=("nelements", "nelements_x_y_or_z"),
        ),
        ystart=dict(
            argstr="-ystart %s",
            requires=("xstart", "zstart"),
            xor=("start", "start_x_y_or_z"),
        ),
        ystep=dict(
            argstr="-ystep %s",
            requires=("xstep", "zstep"),
            xor=("step", "step_x_y_or_z"),
        ),
        zdircos=dict(
            argstr="-zdircos %s",
            requires=("xdircos", "ydircos"),
            xor=("dircos", "dircos_x_y_or_z"),
        ),
        znelements=dict(
            argstr="-znelements %s",
            requires=("xnelements", "ynelements"),
            xor=("nelements", "nelements_x_y_or_z"),
        ),
        zstart=dict(
            argstr="-zstart %s",
            requires=("xstart", "ystart"),
            xor=("start", "start_x_y_or_z"),
        ),
        zstep=dict(
            argstr="-zstep %s",
            requires=("xstep", "ystep"),
            xor=("step", "step_x_y_or_z"),
        ),
    )
    inputs = Resample.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_Resample_outputs():
    output_map = dict(output_file=dict(extensions=None,),)
    outputs = Resample.output_spec()

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