def __init__(self, feature, texture_feature='contrast', distance=1, angle=0, levels=8, window_size=3,
                 stride=1):
        """
        :param feature: A feature that will be used and a new feature name where data will be saved. If new name is not
        specified it will be saved with name '<feature_name>_HARALICK'

        Example: (FeatureType.DATA, 'bands') or (FeatureType.DATA, 'bands', 'haralick_values')

        :type feature: (FeatureType, str) or (FeatureType, str, str)
        :param texture_feature: Type of Haralick textural feature to be calculated
        :type texture_feature: str
        :param distance: Distance between pairs of pixels used for GLCM
        :type distance: int
        :param angle: Angle between pairs of pixels used for GLCM in radians, e.g. angle=np.pi/4
        :type angle: float
        :param levels: Number of bins in GLCM
        :type levels: int
        :param window_size: Size of the moving GLCM window
        :type window_size: int
        :param stride: How much the GLCM window moves each time
        :type stride: int
        """
        self.feature = self._parse_features(feature, default_feature_type=FeatureType.DATA, new_names=True,
                                            rename_function='{}_HARALICK'.format)

        self.texture_feature = texture_feature
        if self.texture_feature not in self.AVAILABLE_TEXTURES.union(self.AVAILABLE_TEXTURES_SKIMAGE):
            raise ValueError('Haralick texture feature must be one of these : {}'.format(
                self.AVAILABLE_TEXTURES.union(self.AVAILABLE_TEXTURES_SKIMAGE)))

        self.distance = distance
        self.angle = angle
        self.levels = levels

        self.window_size = window_size
        if self.window_size % 2 != 1:
            raise ValueError('Window size must be an odd number')

        self.stride = stride
        if self.stride >= self.window_size + 1:
            warnings.warn('Haralick stride is superior to the window size; some pixel values will be ignored')
def __init__ ( self , feature , texture_feature = 'contrast' , distance = 1 , angle = 0 , levels = 8 , window_size = 3 , stride = 1 ) : self . feature = self . _parse_features ( feature , default_feature_type = FeatureType . DATA , new_names = True , rename_function = '{}_HARALICK' . format ) self . texture_feature = texture_feature if self . texture_feature not in self . AVAILABLE_TEXTURES . union ( self . AVAILABLE_TEXTURES_SKIMAGE ) : raise ValueError ( 'Haralick texture feature must be one of these : {}' . format ( self . AVAILABLE_TEXTURES . union ( self . AVAILABLE_TEXTURES_SKIMAGE ) ) ) self . distance = distance self . angle = angle self . levels = levels self . window_size = window_size if self . window_size % 2 != 1 : raise ValueError ( 'Window size must be an odd number' ) self . stride = stride if self . stride >= self . window_size + 1 : warnings . warn ( 'Haralick stride is superior to the window size; some pixel values will be ignored' )
:param feature: A feature that will be used and a new feature name where data will be saved. If new name is not
        specified it will be saved with name '<feature_name>_HARALICK'

        Example: (FeatureType.DATA, 'bands') or (FeatureType.DATA, 'bands', 'haralick_values')

        :type feature: (FeatureType, str) or (FeatureType, str, str)
        :param texture_feature: Type of Haralick textural feature to be calculated
        :type texture_feature: str
        :param distance: Distance between pairs of pixels used for GLCM
        :type distance: int
        :param angle: Angle between pairs of pixels used for GLCM in radians, e.g. angle=np.pi/4
        :type angle: float
        :param levels: Number of bins in GLCM
        :type levels: int
        :param window_size: Size of the moving GLCM window
        :type window_size: int
        :param stride: How much the GLCM window moves each time
        :type stride: int