def medianFilter(self, kernel_size=5):
        """
        **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)
        """
        try:
            from scipy.signal import medfilt
        except __HOLE__:
            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
dataset/ETHPy150Open sightmachine/SimpleCV/SimpleCV/LineScan.py/LineScan.medianFilter