Usage: ConvertScalarImageToRGB imageDimension inputImage outputImage mask colormap 
    [customColormapFile] [minimumInput] [maximumInput] [minimumRGBOutput=0] 
    [maximumRGBOutput=255] <vtkLookupTable>
    Possible colormaps: grey, red, green, blue, copper, jet, hsv, spring, summer, autumn, winter, hot, cool, overunder, custom
    
    Example
    -------
    >>> import ants
    >>> img = ants.image_read(ants.get_data('r16'))
    >>> img_color = img.scalar_to_rgb(cmap='jet')

def scalar_to_rgb(image, mask=None, filename=None, cmap='red', custom_colormap_file=None, 
                  min_input=None, max_input=None, min_rgb_output=None, max_rgb_output=None,
                  vtk_lookup_table=None):
    """
    Usage: ConvertScalarImageToRGB imageDimension inputImage outputImage mask colormap 
    [customColormapFile] [minimumInput] [maximumInput] [minimumRGBOutput=0] 
    [maximumRGBOutput=255] <vtkLookupTable>
    Possible colormaps: grey, red, green, blue, copper, jet, hsv, spring, summer, autumn, winter, hot, cool, overunder, custom
    
    Example
    -------
    >>> import ants
    >>> img = ants.image_read(ants.get_data('r16'))
    >>> img_color = img.scalar_to_rgb(cmap='jet')
    """

    if filename is None:
        file_is_temp = True
        filename = mktemp(suffix='.png')
    else:
        file_is_temp = False

    args = 'imageDimension inputImage outputImage mask colormap'.split(' ')
    args[0] = image.dimension

    if isinstance(image, iio.ANTsImage):
        tmpimgfile = mktemp(suffix='.nii.gz')
        image.to_file(tmpimgfile)
    elif isinstance(image, str):
        tmpimgfile = image
    args[1] = tmpimgfile
    args[2] = filename
    args[3] = mask if mask is not None else image.new_image_like(np.ones(image.shape))
    args[4] = cmap
    if custom_colormap_file is not None:
        args.append('customColormapFile=%s' % custom_colormap_file)
    if min_input is not None:
        args.append('minimumInput=%f' % min_input)
    if max_input is not None:
        args.append('maximumInput=%f' % max_input)
    if min_rgb_output is not None:
        args.append('minRGBOutput=%f' % min_rgb_output)
    if max_rgb_output is not None:
        args.append('maxRGBOutput=%f' % min_rgb_output)
    if vtk_lookup_table is not None:
        vtk_lookup_table = mktemp(suffix='.csv')
        args.append('vtkLookupTable=%s' % vtk_lookup_table)
    
    processed_args = utils._int_antsProcessArguments(args)
    libfn = utils.get_lib_fn('ConvertScalarImageToRGB')
    libfn(processed_args)

    if file_is_temp:
        outimg = iio2.image_read(filename, pixeltype=None)
        # clean up temp files
        os.remove(filename)
        os.remove(tmpimgfile)

        return outimg
    else:
        os.remove(tmpimgfile)