'**SUMMARY**
Apply median filter on the data
**PARAMETERS**
* *kernel_size* - Size of the filter (should be odd int) - int
**RETURNS**
A LineScan object with the median filter applied to the values.
**EXAMPLE**
>>> ls = img.getLineScan(x=10)
>>> mf = ls.medianFilter()
>>> plt.plot(ls)
>>> plt.plot(mf)'

def medianFilter(self, kernel_size=5):

    try:
        from scipy.signal import medfilt
    except ImportError:
        warnings.warn('Scipy    vesion    >=    0.11    requierd.')
        return None
    if ((kernel_size % 2) == 0):
        kernel_size -= 1
        print 'Kernel    Size    should    be    odd.    New    kernel    size    =', kernel_size
    medfilt_array = medfilt(np.asarray(self[:]), kernel_size)
    retVal = LineScan(medfilt_array.astype('uint8').tolist(), image=self.image, pointLoc=self.pointLoc, pt1=self.pt1, pt2=self.pt2, x=self.col, y=self.row)
    retVal._update(self)
    return retVal
