def add_argparse_options(parser):
    """Add command-line options for downscaling.

    :param argparse.ArgumentParser parser: an argument parser

    The downscaling options can be obtained from command-line arguments with
    :func:`add_argparse_options` and passed to :func:`get_downscaler`::

        import argparse
        parser = argparse.ArgumentParser()
        add_argparse_options(parser)
        args = parser.parse_args()
        get_downscaler(args.downscaling_method, vars(args))
    """
    group = parser.add_argument_group('Options for downscaling')
    group.add_argument('--downscaling-method', default='auto', choices=(
        'auto', 'average', 'majority', 'stride'), help=
        'The default is "auto", which chooses "average" or "stride" depending on the "type" attribute of the dataset (for "image" or "segmentation", respectively). "average" is recommended for grey-level images. "majority" is a high-quality, but very slow method for segmentation images. "stride" is fastest, but provides no protection against aliasing artefacts.'
        )
    group.add_argument('--outside-value', type=float, default=None, help=
        'padding value used by the "average" downscaling method for computing the voxels at the border. If omitted, the volume is padded with its edge values.'
        )
