<commit_before>itk_module_test()
set(ITKDenoisingTests
itkPatchBasedDenoisingImageFilterTest.cxx
itkPatchBasedDenoisingImageFilterDefaultTest.cxx
)

CreateTestDriver(ITKDenoising  "${ITKDenoising-Test_LIBRARIES}" "${ITKDenoisingTests}")

itk_add_test(NAME itkPatchBasedDenoisingImageFilterDefaultTest
      COMMAND ITKDenoisingTestDriver
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterDefaultTest.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterDefaultTest.mha
    itkPatchBasedDenoisingImageFilterDefaultTest
      DATA{Input/noisy_checkerboard.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterDefaultTest.mha
      2)
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTest0
      COMMAND ITKDenoisingTestDriver
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterTest0.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTest0.mha
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/noisy_checkerboard.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTest0.mha
      2 1 14.093142951003070 2 2 200)
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTestGaussian
      COMMAND ITKDenoisingTestDriver
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterTestGaussian.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestGaussian.mha
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/checkerboard_noise10Gaussian.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestGaussian.mha
      2 1 14.418708309529121 2 2 200 0 1 GAUSSIAN 0.1)
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTestRician
      COMMAND ITKDenoisingTestDriver
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterTestRician.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestRician.mha
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/checkerboard_noise10Rician.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestRician.mha
      2 1 12.283962106667094 2 2 200 0 1 RICIAN 0.1)
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTestPoisson
      COMMAND ITKDenoisingTestDriver
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterTestPoisson.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestPoisson.mha
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/checkerboard_noise10Poisson.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestPoisson.mha
      2 1 9.9250532200729378 2 2 200 0 1 POISSON 0.1)
# Extra tolerance for Tensors. The alternative EigenValues-computation of this class is faster,
# but numerically unstable. The extra tolerance covers the difference between 64 and 32 bits machines.
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTestTensors
      COMMAND ITKDenoisingTestDriver
    --compareNumberOfPixelsTolerance 10
    --compare
      DATA{Baseline/PatchBasedDenoisingImageFilterTestTensors.nrrd}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestTensors.nrrd
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/noisyDiffusionTensors.nrrd}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestTensors.nrrd
      2 6 5.4377394641246628 2 2 100 0 2)<commit_msg>COMP: Add tolerance for patch-based denoising tests on Apple M1<commit_after>itk_module_test()
set(ITKDenoisingTests
itkPatchBasedDenoisingImageFilterTest.cxx
itkPatchBasedDenoisingImageFilterDefaultTest.cxx
)

CreateTestDriver(ITKDenoising  "${ITKDenoising-Test_LIBRARIES}" "${ITKDenoisingTests}")

itk_add_test(NAME itkPatchBasedDenoisingImageFilterDefaultTest
      COMMAND ITKDenoisingTestDriver
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterDefaultTest.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterDefaultTest.mha
    itkPatchBasedDenoisingImageFilterDefaultTest
      DATA{Input/noisy_checkerboard.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterDefaultTest.mha
      2)
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTest0
      COMMAND ITKDenoisingTestDriver
    --compareRadiusTolerance 2
    --compareIntensityTolerance 15
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterTest0.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTest0.mha
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/noisy_checkerboard.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTest0.mha
      2 1 14.093142951003070 2 2 200)
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTestGaussian
      COMMAND ITKDenoisingTestDriver
    --compareRadiusTolerance 2
    --compareIntensityTolerance 15
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterTestGaussian.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestGaussian.mha
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/checkerboard_noise10Gaussian.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestGaussian.mha
      2 1 14.418708309529121 2 2 200 0 1 GAUSSIAN 0.1)
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTestRician
      COMMAND ITKDenoisingTestDriver
    --compareRadiusTolerance 2
    --compareIntensityTolerance 15
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterTestRician.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestRician.mha
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/checkerboard_noise10Rician.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestRician.mha
      2 1 12.283962106667094 2 2 200 0 1 RICIAN 0.1)
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTestPoisson
      COMMAND ITKDenoisingTestDriver
    --compareRadiusTolerance 3
    --compareIntensityTolerance 8
    --compare DATA{Baseline/PatchBasedDenoisingImageFilterTestPoisson.mha}
              ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestPoisson.mha
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/checkerboard_noise10Poisson.mha}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestPoisson.mha
      2 1 9.9250532200729378 2 2 200 0 1 POISSON 0.1)
# Extra tolerance for Tensors. The alternative EigenValues-computation of this class is faster,
# but numerically unstable. The extra tolerance covers the difference between 64 and 32 bits machines.
itk_add_test(NAME itkPatchBasedDenoisingImageFilterTestTensors
      COMMAND ITKDenoisingTestDriver
    --compareNumberOfPixelsTolerance 10
    --compare
      DATA{Baseline/PatchBasedDenoisingImageFilterTestTensors.nrrd}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestTensors.nrrd
    itkPatchBasedDenoisingImageFilterTest
      DATA{Input/noisyDiffusionTensors.nrrd}
      ${ITK_TEST_OUTPUT_DIR}/PatchBasedDenoisingImageFilterTestTensors.nrrd
      2 6 5.4377394641246628 2 2 100 0 2)
{'fraction_non_alphanumeric': 0.052840158520475564, 'fraction_numerical': 0.046088360487303685, 'mean_word_length': 5.326833797585887, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3217908', 'n_tokens_mistral': 2455, 'n_tokens_neox': 2156, 'n_words': 306}