class_docstr: Extracts a single label from all the given classes, the single label is defined by mask_value, the remaining
  labels are kept in others
  
  Args:
      label: key of the label source
      others: other labels storage key, defaults to ``"others"``
      mask_value: the mask_value that will be kept for binarization of the label, defaults to ``"mask_value"``
      min_area: The smallest allowable object size.
      others_value: Value/class for other nuclei;  Use this to separate core nuclei vs others.
      to_binary_mask: Convert mask to binary;  Set it false to restore original class values
class_docstr_tok: ["Extracts","a","single","label","from","all","the","given","classes",",","the","single","label","is","defined","by","mask_value",",","the","remaining","labels","are","kept","in","others","Args",":","label",":","key","of","the","label","source","others",":","other","labels","storage","key",",","defaults","to","``","``","others","''","``","mask_value",":","the","mask_value","that","will","be","kept","for","binarization","of","the","label",",","defaults","to","``","``","mask_value","''","``","min_area",":","The","smallest","allowable","object","size",".","others_value",":","Value\/class","for","other","nuclei",";","Use","this","to","separate","core","nuclei","vs","others",".","to_binary_mask",":","Convert","mask","to","binary",";","Set","it","false","to","restore","original","class","values"]
code: def __call__(self, data):
      d = dict(data)
  
      if len(self.keys) > 1:
          print(
              "Only 'label' key is supported, more than 1 key was found"
          )
          return None
  
      for key in self.keys:
          label = (
              d[key]
              if isinstance(d[key], torch.Tensor)
              else torch.from_numpy(d[key])
          )
  
          mask = torch.clone(label)
          if self.mask_value:
              mask_value = d[self.mask_value]
              mask[label != mask_value] = 0
          else:
              mask[label >= self.others_value] = 0
              mask_value = int(torch.max(mask))
  
          if self.to_binary_mask:
              mask[mask > 0] = 1
  
          others = torch.clone(label)
          others[label == mask_value] = 0
          others[others > 0] = 1
          if torch.count_nonzero(others):
              others = measure.label(
                  convert_to_numpy(others)[0], connectivity=1
              )
              others = torch.from_numpy(others)[None]
  
          label = (
              mask.type(torch.uint8)
              if isinstance(mask, torch.Tensor)
              else mask
          )
          others = (
              others.type(torch.uint8)
              if isinstance(others, torch.Tensor)
              else others
          )
  
          d[key] = (
              label
              if isinstance(d[key], torch.Tensor)
              else convert_to_numpy(label)
          )
          d[self.others] = (
              others
              if isinstance(d[key], torch.Tensor)
              else convert_to_numpy(others)
          )
  
      return d
  
imports: from __future__ import annotations
  import math
  from typing import Any
  import numpy
  import torch
  from monai.config import KeysCollection, NdarrayOrTensor
  from monai.networks.layers import GaussianFilter
  from monai.transforms import MapTransform, Randomizable, SpatialPad
  from monai.utils import StrEnum, convert_to_numpy, optional_import
label_desc: Use image node_id 2 for calling the SplitLabeld obj's underlying member method code with example usage: obj.__call__(data) and returns: d, None