'**SUMMARY**
This function helps you put back the linescan in the image.
**PARAMETERS**
* *linescan* - LineScan object
* *x* - put  line scan at the column x.
* *y* - put line scan at the row y.
* *pt1* - put line scan between two points on the line the line scan values always go in the +x direction
* *pt2* - Second parameter for a non-vertical or horizontal line scan.
* *channel* - To select a channel. eg: selecting a channel RED,GREEN or BLUE. If set to -1 it operates with gray scale values
**RETURNS**
A SimpleCV.Image
**EXAMPLE**
>>> img = Image(\'lenna\')
>>> a = img.getLineScan(x=10)
>>> for index in range(len(a)):
... a[index] = 0
>>> newimg = img.putLineScan(a, x=50)
>>> newimg.show()
# This will show you a black line in column 50.'

def setLineScan(self, linescan, x=None, y=None, pt1=None, pt2=None, channel=(-1)):

    if (channel == (-1)):
        img = np.copy(self.getGrayNumpy())
    else:
        try:
            img = np.copy(self.getNumpy()[:, :, channel])
        except IndexError:
            print 'Channel    missing!'
            return None
    if ((x is None) and (y is None) and (pt1 is None) and (pt2 is None)):
        if ((linescan.pt1 is None) or (linescan.pt2 is None)):
            warnings.warn('ImageClass.setLineScan:    No    coordinates    to    re-insert    linescan.')
            return None
        else:
            pt1 = linescan.pt1
            pt2 = linescan.pt2
            if ((pt1[0] == pt2[0]) and (np.abs((pt1[1] - pt2[1])) == self.height)):
                x = pt1[0]
                pt1 = None
                pt2 = None
            elif ((pt1[1] == pt2[1]) and (np.abs((pt1[0] - pt2[0])) == self.width)):
                y = pt1[1]
                pt1 = None
                pt2 = None
    retVal = None
    if ((x is not None) and (y is None) and (pt1 is None) and (pt2 is None)):
        if ((x >= 0) and (x < self.width)):
            if (len(linescan) != self.height):
                linescan = linescan.resample(self.height)
            img[x, :] = np.clip(linescan[:], 0, 255)
        else:
            warnings.warn('ImageClass.setLineScan:    No    coordinates    to    re-insert    linescan.')
            return None
    elif ((x is None) and (y is not None) and (pt1 is None) and (pt2 is None)):
        if ((y >= 0) and (y < self.height)):
            if (len(linescan) != self.width):
                linescan = linescan.resample(self.width)
            img[:, y] = np.clip(linescan[:], 0, 255)
        else:
            warnings.warn('ImageClass.setLineScan:    No    coordinates    to    re-insert    linescan.')
            return None
    elif ((isinstance(pt1, tuple) or isinstance(pt1, list)) and (isinstance(pt2, tuple) or isinstance(pt2, list)) and (len(pt1) == 2) and (len(pt2) == 2) and (x is None) and (y is None)):
        pts = self.bresenham_line(pt1, pt2)
        if (len(linescan) != len(pts)):
            linescan = linescan.resample(len(pts))
        linescan = np.clip(linescan[:], 0, 255)
        idx = 0
        for pt in pts:
            img[(pt[0], pt[1])] = linescan[idx]
            idx = (idx + 1)
    else:
        warnings.warn('ImageClass.setLineScan:    No    coordinates    to    re-insert    linescan.')
        return None
    if (channel == (-1)):
        retVal = Image(img)
    else:
        temp = np.copy(self.getNumpy())
        temp[:, :, channel] = img
        retVal = Image(temp)
    return retVal
