code: def get_slices_points(self, label, initial_foreground):
      if isinstance(label, torch.Tensor):
          label = label.numpy()
      logger.debug(f"Label shape: {label.shape}")
  
      foreground_all = initial_foreground
      max_slices = label.shape[0]
      for i in range(max_slices):
          lab = label[i, :, :]
          if np.sum(lab) == 0:
              continue
  
          lab = lab[np.newaxis]
          foreground = []
  
          # get largest cc
          lab = LargestCCd.get_largest_cc(lab)
          if np.sum(lab) < self.min_point_density:
              logger.debug(
                  f"Ignoring this slice: {i}; min existing points: {self.min_point_density}"
              )
              continue
  
          # Add initial point  based on CDT/Distance
          t = AddInitialSeedPointd()
          guidance = t._apply(lab, None)
          for point in guidance[0]:
              if np.any(np.asarray(point) < 0):
                  continue
              foreground.append([point[-2], point[-1]])
              foreground_all.append([point[-2], point[-1], i])
  
          # Add Random points
          points = self.get_random_points(lab[0])
          for point in points:
              foreground.append([point[-2], point[-1]])
              foreground_all.append([point[-2], point[-1], i])
          # logger.debug('Slice: {}; Sum: {}; Foreground Points: {}'.format(i, np.sum(lab), foreground))
  
      logger.info(f"Total Foreground Points: {len(foreground_all)}")
      slices = list(
          set((np.array(foreground_all)[:, 2]).astype(int).tolist())
      )
      logger.info(
          f"Total slices: {len(slices)}; min: {min(slices)}; max: {max(slices)}"
      )
      return foreground_all, slices
  
imports: import logging
  import os
  from typing import Callable, Sequence
  import numpy
  import torch
  from monai.apps.deepgrow.transforms import AddGuidanceFromPointsd, AddGuidanceSignald, AddInitialSeedPointd, ResizeGuidanced, RestoreLabeld, SpatialCropGuidanced
  from monai.inferers import Inferer, SimpleInferer
  from monai.transforms import AsChannelLastd, EnsureChannelFirstd, LoadImage, LoadImaged, NormalizeIntensityd, Resized, Spacingd, Transpose, Transposed
  from monailabel.interfaces.tasks.infer_v2 import InferTask, InferType
  from monailabel.tasks.infer.basic_infer import BasicInferTask
  from monailabel.transform.post import BoundingBoxd, LargestCCd
label_desc: Use image node_id 9 for calling the InferDeepgrowPipeline obj's underlying member method code with example usage: obj.get_slices_points(label, initial_foreground) and returns: foreground_all,  slices