code: def test_sphere(self):
      # (B, W, H, D)
      volume = torch.Tensor(
          [
              [
                  [
                      (x - 10) ** 2 + (y - 10) ** 2 + (z - 10) ** 2
                      for z in range(20)
                  ]
                  for y in range(20)
              ]
              for x in range(20)
          ]
      ).unsqueeze(0)
      volume = volume.permute(0, 3, 2, 1)  # (B, D, H, W)
      verts, faces = marching_cubes_naive(
          volume, isolevel=64, return_local_coords=False
      )
  
      data_filename = "test_marching_cubes_data/sphere_level64.pickle"
      filename = os.path.join(DATA_DIR, data_filename)
      with open(filename, "rb") as file:
          verts_and_faces = pickle.load(file)
      expected_verts = verts_and_faces["verts"]
      expected_faces = verts_and_faces["faces"]
  
      self.assertClose(verts[0], expected_verts)
      self.assertClose(faces[0], expected_faces)
  
      verts, faces = marching_cubes(
          volume, 64, return_local_coords=False
      )
      self.assertClose(verts[0], expected_verts)
      self.assertClose(faces[0], expected_faces)
  
      verts, faces = marching_cubes_naive(
          volume, isolevel=64, return_local_coords=True
      )
  
      expected_verts = convert_to_local(expected_verts, 20)
      self.assertClose(verts[0], expected_verts)
      self.assertClose(faces[0], expected_faces)
  
      # Check all values are in the range [-1, 1]
      self.assertTrue(verts[0].ge(-1).all() and verts[0].le(1).all())
  
      verts, faces = marching_cubes(
          volume, 64, return_local_coords=True
      )
      self.assertClose(verts[0], expected_verts)
      self.assertClose(faces[0], expected_faces)
      self.assertTrue(verts[0].ge(-1).all() and verts[0].le(1).all())
  
imports: import os
  import pickle
  import unittest
  import torch
  from pytorch3d.ops.marching_cubes import marching_cubes, marching_cubes_naive
  from .common_testing import get_tests_dir, TestCaseMixin
label_desc: Use image node_id 4 for calling the TestMarchingCubes obj's underlying member method code with example usage: obj.test_sphere() without return types