class_docstr: This dataset extracts patches from whole slide images (without loading the whole image)
  It also reads labels for each patch and provides each patch with its associated class labels.
  
  Args:
      data: the list of input samples including image, location, and label (see the note below for more details).
      patch_size: the size of patch to be extracted from the whole slide image.
      patch_level: the level at which the patches to be extracted (default to 0).
      transform: transforms to be executed on input data.
      include_label: whether to load and include labels in the output
      center_location: whether the input location information is the position of the center of the patch
      additional_meta_keys: the list of keys for items to be copied to the output metadata from the input data
      reader: the module to be used for loading whole slide imaging. If `reader` is
  
          - a string, it defines the backend of `monai.data.WSIReader`. Defaults to cuCIM.
          - a class (inherited from `BaseWSIReader`), it is initialized and set as wsi_reader.
          - an instance of a class inherited from `BaseWSIReader`, it is set as the wsi_reader.
  
      kwargs: additional arguments to pass to `WSIReader` or provided whole slide reader class
  
  Returns:
      dict: a dictionary of loaded image (in MetaTensor format) along with the labels (if requested).
      {"image": MetaTensor, "label": torch.Tensor}
  
  Note:
      The input data has the following form as an example:
  
      .. code-block:: python
  
          [
              {"image": "path/to/image1.tiff", "location": [200, 500], "label": 0},
              {"image": "path/to/image2.tiff", "location": [100, 700], "patch_size": [20, 20], "patch_level": 2, "label": 1}
          ]
class_docstr_tok: ["This","dataset","extracts","patches","from","whole","slide","images","(","without","loading","the","whole","image",")","It","also","reads","labels","for","each","patch","and","provides","each","patch","with","its","associated","class","labels",".","Args",":","data",":","the","list","of","input","samples","including","image",",","location",",","and","label","(","see","the","note","below","for","more","details",")",".","patch_size",":","the","size","of","patch","to","be","extracted","from","the","whole","slide","image",".","patch_level",":","the","level","at","which","the","patches","to","be","extracted","(","default","to","0",")",".","transform",":","transforms","to","be","executed","on","input","data",".","include_label",":","whether","to","load","and","include","labels","in","the","output","center_location",":","whether","the","input","location","information","is","the","position","of","the","center","of","the","patch","additional_meta_keys",":","the","list","of","keys","for","items","to","be","copied","to","the","output","metadata","from","the","input","data","reader",":","the","module","to","be","used","for","loading","whole","slide","imaging",".","If","`","reader","`","is","-","a","string",",","it","defines","the","backend","of","`","monai.data.WSIReader","`",".","Defaults","to","cuCIM",".","-","a","class","(","inherited","from","`","BaseWSIReader","`",")",",","it","is","initialized","and","set","as","wsi_reader",".","-","an","instance","of","a","class","inherited","from","`","BaseWSIReader","`",",","it","is","set","as","the","wsi_reader",".","kwargs",":","additional","arguments","to","pass","to","`","WSIReader","`","or","provided","whole","slide","reader","class","Returns",":","dict",":","a","dictionary","of","loaded","image","(","in","MetaTensor","format",")","along","with","the","labels","(","if","requested",")",".","{","``","image","''",":","MetaTensor",",","``","label","''",":","torch.Tensor","}","Note",":","The","input","data","has","the","following","form","as","an","example",":","..","code-block",":",":","python","[","{","``","image","''",":","``","path\/to\/image1.tiff","''",",","``","location","''",":","[","200",",","500","]",",","``","label","''",":","0","}",",","{","``","image","''",":","``","path\/to\/image2.tiff","''",",","``","location","''",":","[","100",",","700","]",",","``","patch_size","''",":","[","20",",","20","]",",","``","patch_level","''",":","2",",","``","label","''",":","1","}","]"]
code: def _get_wsi_object(self, sample: dict):
      image_path = sample[CommonKeys.IMAGE]
      if image_path not in self.wsi_object_dict:
          self.wsi_object_dict[image_path] = self.wsi_reader.read(
              image_path
          )
      return self.wsi_object_dict[image_path]
  
imports: from __future__ import annotations
  import inspect
  import os
  from collections.abc import Callable, Sequence
  import numpy
  import torch
  from monai.data import Dataset
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import iter_patch_position
  from monai.data.wsi_reader import BaseWSIReader, WSIReader
  from monai.transforms import ForegroundMask, Randomizable, apply_transform
  from monai.utils import convert_to_dst_type, ensure_tuple_rep
  from monai.utils.enums import CommonKeys, ProbMapKeys, WSIPatchKeys
label_desc: Use image node_id 2 for calling the PatchWSIDataset obj's underlying member method code with example usage: obj._get_wsi_object(sample) and returns: self