<commit_before>package org.statismo.stk.core.image

import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers
import org.statismo.stk.core.image.filter.{GaussianFilter3D, GaussianFilter2D, GaussianFilter1D}
import org.statismo.stk.core.numerics.{GridSampler, UniformSampler, Integrator, IntegratorConfiguration}
import org.statismo.stk.core.geometry._



class FilterTest extends FunSpec with ShouldMatchers {
  
  describe("A Gaussian 1D Filter") {
    it("integrates to 1") {
      val gf = GaussianFilter1D(10)

      val grid = DiscreteImageDomain(gf.support.origin, (gf.support.extent - gf.support.origin) * (1.0 / 1000), Index(1000))

      val integrator = Integrator[_1D](IntegratorConfiguration(GridSampler(grid)))
      val value = integrator.integrateScalar((x: Point[_1D]) => Some(gf(x)))

      value should be(1f plusOrMinus 0.01f)
    }
  }
  describe("A Gaussian 2D Filter") {
    it("integrates to 1") {
      val gf = GaussianFilter2D(10)

      val grid = DiscreteImageDomain(gf.support.origin, (gf.support.extent - gf.support.origin) * (1.0 / 600), Index(601, 601))

      val integrator = Integrator[_2D](IntegratorConfiguration(GridSampler(grid)))

      val value = integrator.integrateScalar((x: Point[_2D]) => Some(gf(x)))

      value should be(1.0f plusOrMinus 0.01f)
    }
  }
  
  describe("A Gaussian 3D Filter") {
    it("integrates to 1") {
      val gf = GaussianFilter3D(10)
      val grid = DiscreteImageDomain(gf.support.origin, (gf.support.extent - gf.support.origin) * (1.0 / 200), Index(200, 200, 200))

      val integrator =  Integrator[_3D](IntegratorConfiguration(GridSampler(grid)))
      val value = integrator.integrateScalar((x: Point[_3D]) => Some(gf(x)))

      value should be(1.0f plusOrMinus 0.1f)
    }
  }
  
  
}<commit_msg>FilterTest commented out, as too much memory needed<commit_after>//package org.statismo.stk.core.image
//
//import org.scalatest.FunSpec
//import org.scalatest.matchers.ShouldMatchers
//import org.statismo.stk.core.image.filter.{GaussianFilter3D, GaussianFilter2D, GaussianFilter1D}
//import org.statismo.stk.core.numerics.{GridSampler, UniformSampler, Integrator, IntegratorConfiguration}
//import org.statismo.stk.core.geometry._
//
//
//
//class FilterTest extends FunSpec with ShouldMatchers {
//
//  describe("A Gaussian 1D Filter") {
//    it("integrates to 1") {
//      val gf = GaussianFilter1D(10)
//
//      val grid = DiscreteImageDomain(gf.support.origin, (gf.support.extent) * (1.0 / 1000), Index(1000))
//
//      val integrator = Integrator[_1D](IntegratorConfiguration(GridSampler(grid)))
//      val value = integrator.integrateScalar((x: Point[_1D]) => Some(gf(x)))
//
//      value should be(1f plusOrMinus 0.01f)
//    }
//  }
//  describe("A Gaussian 2D Filter") {
//    it("integrates to 1") {
//      val gf = GaussianFilter2D(10)
//
//      val grid = DiscreteImageDomain(gf.support.origin, (gf.support.extent) * (1.0 / 600), Index(601, 601))
//
//      val integrator = Integrator[_2D](IntegratorConfiguration(GridSampler(grid)))
//
//      val value = integrator.integrateScalar((x: Point[_2D]) => Some(gf(x)))
//
//      value should be(1.0f plusOrMinus 0.01f)
//    }
//  }
//
//  describe("A Gaussian 3D Filter") {
//    it("integrates to 1") {
//      val gf = GaussianFilter3D(10)
//      val grid = DiscreteImageDomain(gf.support.origin, (gf.support.extent) * (1.0 / 200), Index(200, 200, 200))
//
//      val integrator =  Integrator[_3D](IntegratorConfiguration(GridSampler(grid)))
//      val value = integrator.integrateScalar((x: Point[_3D]) => Some(gf(x)))
//
//      value should be(1.0f plusOrMinus 0.1f)
//    }
//  }
//
//
//}
{'fraction_non_alphanumeric': 0.15338427947598254, 'fraction_numerical': 0.039301310043668124, 'mean_word_length': 3.4424242424242424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3630961', 'n_tokens_mistral': 1361, 'n_tokens_neox': 1246, 'n_words': 242}