code: def test_all_constraints_3d(self):
      test_x, test_y, test_z = 1, 2, 3
  
      aff_c = AffineWarpConstraints.translation_3d(
          x=test_x, y=test_y, z=test_z
      )
      self.assertEqual(
          aff_c.constraints,
          (
              (None, None, None, 1),
              (None, None, None, 2),
              (None, None, None, 3),
          ),
      )
  
      aff_c = AffineWarpConstraints.scale_3d(
          x=test_x, y=test_y, z=test_z
      )
      self.assertEqual(
          aff_c.constraints,
          (
              (1, None, None, None),
              (None, 2, None, None),
              (None, None, 3, None),
          ),
      )
  
      aff_c = AffineWarpConstraints.no_shear_3d()
      self.assertEqual(
          aff_c.constraints,
          ((None, 0, 0, None), (0, None, 0, None), (0, 0, None, None)),
      )
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import tensorflow
  from niftynet.layer.grid_warper import AffineGridWarperLayer
  from niftynet.layer.grid_warper import AffineWarpConstraints
  from niftynet.layer.grid_warper import _create_affine_features
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 4 for calling the AffineWarpConstraintsTest obj's underlying member method code with example usage: obj.test_all_constraints_3d() without return types