class_docstr: Test the Tamura Texture features programmed in medpy.features.texture.
  Functions are:  coarseness(image, voxelspacing = None, mask = slice(None))
                  contrast(image, mask = slice(None))
                  directionality(image, voxelspacing = None, mask = slice(None), min_distance = 4)
code: def test_Coarseness(self):
      res = coarseness(self.image1)
      self.assertEqual(
          res,
          1.33,
          "coarseness: 2D image [1,0,0...], no voxelspacing, no mask: got {} ,expected {}".format(
              res, 1.33
          ),
      )
  
      res = coarseness(self.image1, voxelspacing=self.voxelspacing1)
      self.assertEqual(
          res,
          1.0,
          "coarseness: 2D image [1,0,0...], voxelspacing = (1,3), no mask: got {} ,expected {}".format(
              res, 1.0
          ),
      )
      # @TODO: there is a very strong relation to the border handle if the texture is very small (1px)
      res = coarseness(
          self.image1, voxelspacing=self.voxelspacing1, mask=self.mask1
      )
      self.assertEqual(
          res,
          76.26,
          "coarseness: 2D image [1,0,0...], voxelspacing = (1,3), mask = [slice(0,50,1),slice(0,50,1)]: got {} ,expected {}".format(
              res, 76.26
          ),
      )
  
      res = coarseness(numpy.zeros([100, 100]))
      self.assertEqual(
          res,
          1.0,
          "coarseness: 2D image [0,0,0,...], no voxelspacing, no mask: got {} ,expected {}".format(
              res, 1.0
          ),
      )
  
      res = coarseness(self.image1, voxelspacing=(1, 2, 3))
      self.assertEqual(
          res,
          None,
          "coarseness: 2D image [1,0,0,...], voxelspacing = (1,2,3), no mask: got {} ,expected {} ".format(
              res, None
          ),
      )
  
file_path: medpy/tests/features_/texture.py
imports: import unittest
  from medpy.features.texture import *
label_desc: Use image node_id 2 for calling the TestTextureFeatures obj's underlying member method code with example usage: obj.test_Coarseness() without return types