'**SUMMARY**
Fill up an existing LUT (look up table) at the indexes specified
by idxs with the value specified by value. This is useful for picking
out specific values.
**PARAMETERS**
* *lut* - An existing LUT (just a list of 255 values).
* *idxs* -  The indexes of the LUT to fill with the value.
This can also be a sample swatch of an image.
* *value* - the value to set the LUT[idx] to
**RETURNS**
An updated LUT.
**EXAMPLE**
>>>> ls = img.getLineScan(x=10)
>>>> lut = ls.createEmptyLUT()
>>>> swatch = img.crop(0,0,10,10)
>>>> ls.fillLUT(lut,swatch,255)
>>>> ls2 = ls.applyLUT(lut)
>>>> plt.plot(ls)
>>>> plt.plot(ls2)
>>>> plt.show()'

def fillLUT(self, lut, idxs, value=255):

    if (idxs.__class__.__name__ == 'Image'):
        npg = idxs.getGrayNumpy()
        npg = npg.reshape([(npg.shape[0] * npg.shape[1])])
        idxs = npg.tolist()
    value = np.clip(value, 0, 255)
    for idx in idxs:
        if ((idx >= 0) and (idx < len(lut))):
            lut[idx] = value
    return lut
