class_docstr: Dictionary-based wrapper of
  :py:class:`monai.transforms.NormalizeIntensity`.
  This is similar to :py:class:`monai.transforms.NormalizeIntensityd`
  and can normalize non-zero values or the entire image. The difference
  is that this transform does normalization according to a reference image.
  
  Args:
      keys: keys of the corresponding items to be transformed.
          See also: monai.transforms.MapTransform
      ref_key: key of the item to be used to normalize items of "keys"
      subtrahend: the amount to subtract by (usually the mean)
      divisor: the amount to divide by (usually the standard deviation)
      nonzero: whether only normalize non-zero values.
      channel_wise: if True, calculate on each channel separately,
          otherwise, calculate on the entire image directly. default
          to False.
      dtype: output data type, if None, same as input image. defaults
          to float32.
      allow_missing_keys: don't raise exception if key is missing.
  
  Example:
      In an image reconstruction task, let keys=["image", "target"] and ref_key=["image"].
      Also, let data be the data dictionary. Then, ReferenceBasedNormalizeIntensityd
      normalizes data["target"] and data["image"] based on the mean-std of data["image"] by
      calling :py:class:`monai.transforms.NormalizeIntensity`.
docstr: This transform can support to normalize ND spatial (channel-first) data.
  It also supports pseudo ND spatial data (e.g., (C,H,W) is a pseudo-3D
  data point where C is the number of slices)
  
  Args:
      data: is a dictionary containing (key,value) pairs from
          the loaded dataset
  
  Returns:
      the new data dictionary
docstr_tok: ["This","transform","can","support","to","normalize","ND","spatial","(","channel-first",")","data",".","It","also","supports","pseudo","ND","spatial","data","(","e.g.",",","(","C",",","H",",","W",")","is","a","pseudo-3D","data","point","where","C","is","the","number","of","slices",")","Args",":","data",":","is","a","dictionary","containing","(","key",",","value",")","pairs","from","the","loaded","dataset","Returns",":","the","new","data","dictionary"]
code: def __call__(
      self, data: Mapping[Hashable, NdarrayOrTensor]
  ) -> dict[Hashable, NdarrayOrTensor]:
      """
      This transform can support to normalize ND spatial (channel-first) data.
      It also supports pseudo ND spatial data (e.g., (C,H,W) is a pseudo-3D
      data point where C is the number of slices)
  
      Args:
          data: is a dictionary containing (key,value) pairs from
              the loaded dataset
  
      Returns:
          the new data dictionary
      """
      d = dict(data)
  
      # prepare the normalizer based on self.ref_key
      if self.default_normalizer.channel_wise:
          # perform channel-wise normalization
          # compute mean of each channel in the input for mean-std normalization
          # subtrahend will have the same shape as image, for example (C,W,D) for a 2D data
          if self.default_normalizer.subtrahend is None:
              subtrahend = np.array(
                  [
                      val.mean()
                      if isinstance(val, ndarray)
                      else val.float().mean().item()
                      for val in d[self.ref_key]
                  ]
              )
          # users can define default values instead of mean
          else:
              subtrahend = self.default_normalizer.subtrahend  # type: ignore
  
          # compute std of each channel in the input for mean-std normalization
          # will have the same shape as subtrahend
          if self.default_normalizer.divisor is None:
              divisor = np.array(
                  [
                      val.std()
                      if isinstance(val, ndarray)
                      else val.float().std(unbiased=False).item()
                      for val in d[self.ref_key]
                  ]
              )
          else:
              # users can define default values instead of std
              divisor = self.default_normalizer.divisor  # type: ignore
      else:
          # perform ordinary normalization (not channel-wise)
          # subtrahend will be a scalar and is the mean of d[self.ref_key], unless user specifies another value
          if self.default_normalizer.subtrahend is None:
              if isinstance(d[self.ref_key], ndarray):
                  subtrahend = d[self.ref_key].mean()  # type: ignore
              else:
                  subtrahend = d[self.ref_key].float().mean().item()  # type: ignore
          # users can define default values instead of mean
          else:
              subtrahend = self.default_normalizer.subtrahend  # type: ignore
  
          # divisor will be a scalar and is the std of d[self.ref_key], unless user specifies another value
          if self.default_normalizer.divisor is None:
              if isinstance(d[self.ref_key], ndarray):
                  divisor = d[self.ref_key].std()  # type: ignore
              else:
                  divisor = d[self.ref_key].float().std(unbiased=False).item()  # type: ignore
          else:
              # users can define default values instead of std
              divisor = self.default_normalizer.divisor  # type: ignore
  
      # this creates a new normalizer instance based on self.ref_key
      normalizer = NormalizeIntensity(
          subtrahend,
          divisor,
          self.default_normalizer.nonzero,
          self.default_normalizer.channel_wise,
          self.default_normalizer.dtype,
      )
  
      # save mean and std
      d["mean"] = subtrahend
      d["std"] = divisor
  
      # perform normalization
      for key in self.key_iterator(d):
          d[key] = normalizer(d[key])
  
      return d
  
imports: from __future__ import annotations
  from collections.abc import Hashable, Mapping, Sequence
  import numpy
  from numpy import ndarray
  from torch import Tensor
  from monai.apps.reconstruction.transforms.array import EquispacedKspaceMask, RandomKspaceMask
  from monai.config import DtypeLike, KeysCollection
  from monai.config.type_definitions import NdarrayOrTensor
  from monai.transforms import InvertibleTransform
  from monai.transforms.croppad.array import SpatialCrop
  from monai.transforms.intensity.array import NormalizeIntensity
  from monai.transforms.transform import MapTransform, RandomizableTransform
  from monai.utils import FastMRIKeys
  from monai.utils.type_conversion import convert_to_tensor
label_desc: Use image node_id 2 for calling the ReferenceBasedNormalizeIntensityd obj's underlying member method code with example usage: obj.__call__(data) and returns: d