class_docstr: Extracts a patch from the given image and label, however it is based on the centroid location.
  The centroid location is a 2D coordinate (H, W). The extracted patch is extracted around the centroid,
  if the centroid is towards the edge, the centroid will not be the center of the image as the patch will be
  extracted from the edges onwards
  
  Args:
      keys: image, label
      centroid_key: key where the centroid values are stored, defaults to ``"centroid"``
      patch_size: size of the extracted patch
      allow_missing_keys: don't raise exception if key is missing.
      pad_kwargs: other arguments for the SpatialPad transform
class_docstr_tok: ["Extracts","a","patch","from","the","given","image","and","label",",","however","it","is","based","on","the","centroid","location",".","The","centroid","location","is","a","2D","coordinate","(","H",",","W",")",".","The","extracted","patch","is","extracted","around","the","centroid",",","if","the","centroid","is","towards","the","edge",",","the","centroid","will","not","be","the","center","of","the","image","as","the","patch","will","be","extracted","from","the","edges","onwards","Args",":","keys",":","image",",","label","centroid_key",":","key","where","the","centroid","values","are","stored",",","defaults","to","``","``","centroid","''","``","patch_size",":","size","of","the","extracted","patch","allow_missing_keys",":","do","n't","raise","exception","if","key","is","missing",".","pad_kwargs",":","other","arguments","for","the","SpatialPad","transform"]
code: def __init__(
      self,
      keys: KeysCollection,
      centroid_key: str = NuclickKeys.CENTROID,
      patch_size: tuple[int, int] | int = 128,
      allow_missing_keys: bool = False,
      **kwargs: Any,
  ):
      super().__init__(keys, allow_missing_keys)
      self.centroid_key = centroid_key
      self.patch_size = patch_size
      self.kwargs = kwargs
  
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 1 to create a new ExtractPatchd object from inherited base classes: MapTransform with example: obj = ExtractPatchd(keys, centroid_key, patch_size, allow_missing_keys)