def _check_valid_data(self, data):
        """Checks that the given data is a float array with four channels.

        Parameters
        ----------
        data : :obj:`numpy.ndarray`
            The data to check.

        Raises
        ------
        ValueError
            If the data is invalid.
        """
        if data.dtype.type is not np.float32 and \
           data.dtype.type is not np.float64:
            raise ValueError(
                'Illegal data type. RGB-D images only support float arrays')

        if len(data.shape) != 3 and data.shape[2] != 4:
            raise ValueError(
                'Illegal data type. RGB-D images only support four channel')

        color_data = data[:, :, :3]
        if np.any((color_data < 0) | (color_data > BINARY_IM_MAX_VAL)):
            raise ValueError(
                'Color channels must be in the range (0, BINARY_IM_MAX_VAL)')
def _check_valid_data ( self , data ) : if data . dtype . type is not np . float32 and data . dtype . type is not np . float64 : raise ValueError ( 'Illegal data type. RGB-D images only support float arrays' ) if len ( data . shape ) != 3 and data . shape [ 2 ] != 4 : raise ValueError ( 'Illegal data type. RGB-D images only support four channel' ) color_data = data [ : , : , : 3 ] if np . any ( ( color_data < 0 ) | ( color_data > BINARY_IM_MAX_VAL ) ) : raise ValueError ( 'Color channels must be in the range (0, BINARY_IM_MAX_VAL)' )
Checks that the given data is a float array with four channels.

        Parameters
        ----------
        data : :obj:`numpy.ndarray`
            The data to check.

        Raises
        ------
        ValueError
            If the data is invalid.