def test_apply(hist_match: HistogramMatching) -> None:
    # pylint: disable=protected-access (W0212)
    hist_match.channels = (0,)
    source = TEST_SRC_IMAGE[:, :, np.newaxis].astype(float)
    reference = TEST_REF_IMAGE[:, :, np.newaxis].astype(float)
    result = hist_match(source, reference)
    expected_result = hist_match._apply(source, reference)
    np.testing.assert_array_equal(result, expected_result)
def test_apply_2d_image(hist_match: HistogramMatching) -> None:
    hist_match.channels = (0,)
    source = TEST_SRC_IMAGE[:, :, np.newaxis]
    reference = TEST_REF_IMAGE[:, :, np.newaxis]
    original_source = np.copy(source)
    original_reference = np.copy(reference)

    result = hist_match(source.astype(float), reference.astype(float))

    assert result.shape == original_source.shape
    assert result.dtype == np.float32
    assert result.ndim == DIM_3

    np.testing.assert_array_equal(source, original_source)
    np.testing.assert_array_equal(reference, original_reference)

    # we test against scikit image histogram matching
    np.testing.assert_array_equal(result, TEST_RES_IMAGE[:, :, np.newaxis])