Repository: Project-MONAI/MONAI

Issue:
Incorrect Documentation for ResampleToMatch
**Describe the bug**
The documentation for calling the "ResampleToMatch" class is incorrect as it specifies 'src_affine' and 'dst_affine' for example, but this does not match the code. The actual parameters are 'src_meta' and 'dst_meta'. The documentation seems to be a copy of  "SpatialResample".    

**To Reproduce**
Steps to reproduce the behavior:
1. See: [Doc](https://docs.monai.io/en/stable/transforms.html#monai.transforms.ResampleToMatch.__call__)
2. Compare with: [Code](https://docs.monai.io/en/stable/_modules/monai/transforms/spatial/array.html#ResampleToMatch.__call__)

**Expected behavior**
Documentation and code should match. 

**Screenshots**
NA 

**Environment**
NA 

**Additional context**
Version 0.9.0



Discussion:
thanks for reporting, would you be interested in creating a patch to fix it?

Resolving patch:
diff --git a/monai/transforms/spatial/array.py b/monai/transforms/spatial/array.py
--- a/monai/transforms/spatial/array.py
+++ b/monai/transforms/spatial/array.py
@@ -297,7 +297,44 @@ def __call__(  # type: ignore
         padding_mode: Union[GridSamplePadMode, str, None] = None,
         align_corners: Optional[bool] = False,
         dtype: DtypeLike = None,
-    ):
+    ) -> Tuple[NdarrayOrTensor, Dict]:
+        """
+        Args:
+            img: input image to be resampled to match ``dst_meta``. It currently supports channel-first arrays with
+                at most three spatial dimensions.
+            src_meta: Dictionary containing the source affine matrix in the form ``{'affine':src_affine}``.
+                If ``affine`` is not specified, an identity matrix is assumed.  Defaults to ``None``.
+                See also:  https://docs.monai.io/en/stable/transforms.html#spatialresample
+            dst_meta: Dictionary containing the target affine matrix and target spatial shape in the form
+                ``{'affine':src_affine, 'spatial_shape':spatial_size}``. If ``affine`` is  not
+                specified, ``src_affine`` is assumed. If ``spatial_shape`` is not specified, spatial size is
+                automatically computed, containing the previous field of view.  Defaults to ``None``.
+                See also: https://docs.monai.io/en/stable/transforms.html#spatialresample
+            mode: {``"bilinear"``, ``"nearest"``}
+                Interpolation mode to calculate output values. Defaults to ``"bilinear"``.
+                See also: https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html
+                When `USE_COMPILED` is `True`, this argument uses
+                ``"nearest"``, ``"bilinear"``, ``"bicubic"`` to indicate 0, 1, 3 order interpolations.
+                See also: https://docs.monai.io/en/stable/networks.html#grid-pull
+            padding_mode: {``"zeros"``, ``"border"``, ``"reflection"``}
+                Padding mode for outside grid values. Defaults to ``"border"``.
+                See also: https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html
+            align_corners: Geometrically, we consider the pixels of the input as squares rather than points.
+                Defaults to ``False``.
+                See also: https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html
+            dtype: data type for resampling computation. Defaults to ``self.dtype`` or
+                ``np.float64`` (for best precision). If ``None``, use the data type of input data.
+                To be compatible with other modules, the output data type is always `float32`.
+
+        Raises:
+            RuntimeError: When ``src_meta`` is missing.
+            RuntimeError: When ``dst_meta`` is missing.
+            ValueError: When the affine matrix of the source image is not invertible.
+
+        Returns:
+            Resampled input image, Metadata
+
+        """
         if src_meta is None:
             raise RuntimeError("`in_meta` is missing")
         if dst_meta is None:
diff --git a/monai/transforms/spatial/dictionary.py b/monai/transforms/spatial/dictionary.py
--- a/monai/transforms/spatial/dictionary.py
+++ b/monai/transforms/spatial/dictionary.py
@@ -412,7 +412,7 @@ def inverse(self, data: Mapping[Hashable, NdarrayOrTensor]) -> Dict[Hashable, Nd
                 dtype=dtype,
             )
             d[key] = img
-            d[src_meta_key] = new_meta
+            d[src_meta_key] = new_meta  # type: ignore
 
             # Remove the applied transform
             self.pop_transform(d, key)


Test patch: