docstr: Test if all values contribute with nearly one to the created histograms.
docstr_tok: ["Test","if","all","values","contribute","with","nearly","one","to","the","created","histograms","."]
code: def test_fuzzy_histogram_contribution(self):
      """Test if all values contribute with nearly one to the created histograms."""
      values = scipy.random.randint(0, 100, 1000)
  
      # test triangular
      h, _ = fuzzy_histogram(
          values, membership="triangular", normed=False, guarantee=True
      )
      self.assertAlmostEqual(
          sum(h),
          values.size,
          msg="Triangular contribution does not equal out. {} != {}.".format(
              sum(h), values.size
          ),
      )
  
      # test trapezoid
      h, _ = fuzzy_histogram(
          values, membership="trapezoid", normed=False, guarantee=True
      )
      self.assertAlmostEqual(
          sum(h),
          values.size,
          msg="Trapezoid contribution does not equal out. {} != {}.".format(
              sum(h), values.size
          ),
      )
  
      # test gaussian
      h, _ = fuzzy_histogram(
          values, membership="gaussian", normed=False, guarantee=True
      )
      self.assertAlmostEqual(
          sum(h),
          values.size,
          msg="Gaussian contribution does not equal out. {} != {}.".format(
              sum(h), values.size
          ),
          delta=values.size * 0.001,
      )  # gaussian maximal error eps
  
      # test sigmoid
      h, _ = fuzzy_histogram(
          values, membership="sigmoid", normed=False, guarantee=True
      )
      self.assertAlmostEqual(
          sum(h),
          values.size,
          msg="Sigmoid contribution does not equal out. {} != {}.".format(
              sum(h), values.size
          ),
          delta=values.size * 0.001,
      )
  
file_path: medpy/tests/features_/histogram.py
imports: import unittest
  import math
  import scipy
  from medpy.features.histogram import fuzzy_histogram, triangular_membership, trapezoid_membership, gaussian_membership, sigmoidal_difference_membership
label_desc: Use image node_id 1 for calling the TestHistogramFeatures obj's underlying member method code with example usage: obj.test_fuzzy_histogram_contribution() without return types