Nic-Ma: /black
diff --git a/monai/transforms/utility/array.py b/monai/transforms/utility/array.py
index c64ae164..861907d3 100644
--- a/monai/transforms/utility/array.py
+++ b/monai/transforms/utility/array.py
@@ -208,17 +208,18 @@ class DataStats(Transform):
         if logger_handler is not None:
             self._logger.addHandler(logger_handler)
 
-    def __call__(self, img):
-        lines = [f"{self.prefix} statistics:"]
+    def __call__(self, img, prefix=None, data_shape=None, intensity_range=None, data_value=None, additional_info=None):
+        lines = [f"{prefix or self.prefix} statistics:"]
 
-        if self.data_shape:
+        if self.data_shape if data_shape is None else data_shape:
             lines.append(f"Shape: {img.shape}")
-        if self.intensity_range:
+        if self.intensity_range if intensity_range is None else intensity_range:
             lines.append(f"Intensity range: ({np.min(img)}, {np.max(img)})")
-        if self.data_value:
+        if self.data_value if data_value is None else data_value:
             lines.append(f"Value: {img}")
-        if self.additional_info:
-            lines.append(f"Additional info: {self.additional_info(img)}")
+        additional_info = self.additional_info if additional_info is None else additional_info
+        if additional_info is not None:
+            lines.append(f"Additional info: {additional_info(img)}")
         separator = "\n"
         self.output = f"{separator.join(lines)}"
         self._logger.debug(self.output)
diff --git a/monai/transforms/utility/dictionary.py b/monai/transforms/utility/dictionary.py
index 2553690c..fc59e911 100644
--- a/monai/transforms/utility/dictionary.py
+++ b/monai/transforms/utility/dictionary.py
@@ -222,22 +222,36 @@ class DataStatsd(MapTransform):
         Args:
             keys (hashable items): keys of the corresponding items to be transformed.
                 See also: :py:class:`monai.transforms.compose.MapTransform`
-            prefix (string): will be printed in format: "{prefix} statistics".
-            data_shape (bool): whether to show the shape of input data.
-            intensity_range (bool): whether to show the intensity value range of input data.
-            data_value (bool): whether to show the raw value of input data.
+            prefix (string or list of string): will be printed in format: "{prefix} statistics".
+            data_shape (bool or list of bool): whether to show the shape of input data.
+            intensity_range (bool or list of bool): whether to show the intensity value range of input data.
+            data_value (bool or list of bool): whether to show the raw value of input data.
                 a typical example is to print some properties of Nifti image: affine, pixdim, etc.
-            additional_info (Callable): user can define callable function to extract additional info from input data.
+            additional_info (Callable or list of Callable): user can define callable function to extract
+                additional info from input data.
             logger_handler (logging.handler): add additional handler to output data: save to file, etc.
                 add existing python logging handlers: https://docs.python.org/3/library/logging.handlers.html
         """
         super().__init__(keys)
-        self.printer = DataStats(prefix, data_shape, intensity_range, data_value, additional_info, logger_handler)
+        self.prefix = ensure_tuple_rep(prefix, len(self.keys))
+        self.data_shape = ensure_tuple_rep(data_shape, len(self.keys))
+        self.intensity_range = ensure_tuple_rep(intensity_range, len(self.keys))
+        self.data_value = ensure_tuple_rep(data_value, len(self.keys))
+        self.additional_info = ensure_tuple_rep(additional_info, len(self.keys))
+        self.logger_handler = logger_handler
+        self.printer = DataStats(logger_handler=logger_handler)
 
     def __call__(self, data):
         d = dict(data)
-        for key in self.keys:
-            d[key] = self.printer(d[key])
+        for idx, key in enumerate(self.keys):
+            d[key] = self.printer(
+                d[key],
+                self.prefix[idx],
+                self.data_shape[idx],
+                self.intensity_range[idx],
+                self.data_value[idx],
+                self.additional_info[idx],
+            )
         return d
 
 

add StatsTransform to debug data in transform chain
**Is your feature request related to a problem? Please describe.**
Currently, our transforms compose a chain and hard to know the data after every transform and debug, need to add StatsTransform which can be inserted into the chain to print expected info.

diff --git a/tests/test_data_statsd.py b/tests/test_data_statsd.py
index 9466584a..e26dfdb7 100644
--- a/tests/test_data_statsd.py
+++ b/tests/test_data_statsd.py
@@ -83,19 +83,32 @@ TEST_CASE_5 = [
 ]
 
 TEST_CASE_6 = [
+    {
+        "keys": ("img", "affine"),
+        "prefix": ("image", "affine"),
+        "data_shape": True,
+        "intensity_range": (True, False),
+        "data_value": (False, True),
+        "additional_info": (lambda x: np.mean(x), None),
+    },
+    {"img": np.array([[0, 1], [1, 2]]), "affine": np.eye(2, 2)},
+    "affine statistics:\nShape: (2, 2)\nValue: [[1. 0.]\n [0. 1.]]",
+]
+
+TEST_CASE_7 = [
     {"img": np.array([[0, 1], [1, 2]])},
     "test data statistics:\nShape: (2, 2)\nIntensity range: (0, 2)\nValue: [[0 1]\n [1 2]]\nAdditional info: 1.0\n",
 ]
 
 
 class TestDataStatsd(unittest.TestCase):
-    @parameterized.expand([TEST_CASE_1, TEST_CASE_2, TEST_CASE_3, TEST_CASE_4, TEST_CASE_5])
+    @parameterized.expand([TEST_CASE_1, TEST_CASE_2, TEST_CASE_3, TEST_CASE_4, TEST_CASE_5, TEST_CASE_6])
     def test_value(self, input_param, input_data, expected_print):
         transform = DataStatsd(**input_param)
         _ = transform(input_data)
         self.assertEqual(transform.printer.output, expected_print)
 
-    @parameterized.expand([TEST_CASE_6])
+    @parameterized.expand([TEST_CASE_7])
     def test_file(self, input_data, expected_print):
         with tempfile.TemporaryDirectory() as tempdir:
             filename = os.path.join(tempdir, "test_stats.log")

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest black flake8 mypy pytype
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
absl-py==1.4.0
attrs==22.2.0
black==22.8.0
cachetools==4.2.4
certifi==2021.5.30
charset-normalizer==2.0.12
click==8.0.4
coverage==6.2
cycler==0.11.0
dataclasses==0.8
decorator==4.4.2
flake8==5.0.4
google-auth==2.22.0
google-auth-oauthlib==0.4.6
grpcio==1.48.2
idna==3.10
imageio==2.15.0
importlab==0.8.1
importlib-metadata==4.8.3
iniconfig==1.1.1
kiwisolver==1.3.1
libcst==0.4.1
Markdown==3.3.7
matplotlib==3.3.4
mccabe==0.7.0
-e git+https://github.com/Project-MONAI/MONAI.git@5ba711376777760b5bad17f9fc09d488c2e68558#egg=monai
mypy==0.971
mypy-extensions==1.0.0
networkx==2.5.1
nibabel==3.2.2
ninja==1.11.1.1
numpy==1.19.5
oauthlib==3.2.2
packaging==21.3
parameterized==0.8.1
pathspec==0.9.0
Pillow==8.4.0
platformdirs==2.4.0
pluggy==1.0.0
protobuf==3.19.6
py==1.11.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycodestyle==2.9.1
pyflakes==2.5.0
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.9.0.post0
pytorch-ignite==0.3.0
pytype==2022.1.5
PyWavelets==1.1.1
PyYAML==6.0.1
requests==2.27.1
requests-oauthlib==2.0.0
rsa==4.9
scikit-image==0.17.2
scipy==1.5.4
six==1.17.0
tabulate==0.8.10
tensorboard==2.10.1
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tifffile==2020.9.3
toml==0.10.2
tomli==1.2.3
torch==1.10.2
typed-ast==1.5.5
typing-inspect==0.9.0
typing_extensions==4.1.1
urllib3==1.26.20
Werkzeug==2.0.3
zipp==3.6.0

name: MONAI
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - absl-py==1.4.0
      - attrs==22.2.0
      - black==22.8.0
      - cachetools==4.2.4
      - charset-normalizer==2.0.12
      - click==8.0.4
      - coverage==6.2
      - cycler==0.11.0
      - dataclasses==0.8
      - decorator==4.4.2
      - flake8==5.0.4
      - google-auth==2.22.0
      - google-auth-oauthlib==0.4.6
      - grpcio==1.48.2
      - idna==3.10
      - imageio==2.15.0
      - importlab==0.8.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - kiwisolver==1.3.1
      - libcst==0.4.1
      - markdown==3.3.7
      - matplotlib==3.3.4
      - mccabe==0.7.0
      - mypy==0.971
      - mypy-extensions==1.0.0
      - networkx==2.5.1
      - nibabel==3.2.2
      - ninja==1.11.1.1
      - numpy==1.19.5
      - oauthlib==3.2.2
      - packaging==21.3
      - parameterized==0.8.1
      - pathspec==0.9.0
      - pillow==8.4.0
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - protobuf==3.19.6
      - py==1.11.0
      - pyasn1==0.5.1
      - pyasn1-modules==0.3.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - pytorch-ignite==0.3.0
      - pytype==2022.1.5
      - pywavelets==1.1.1
      - pyyaml==6.0.1
      - requests==2.27.1
      - requests-oauthlib==2.0.0
      - rsa==4.9
      - scikit-image==0.17.2
      - scipy==1.5.4
      - six==1.17.0
      - tabulate==0.8.10
      - tensorboard==2.10.1
      - tensorboard-data-server==0.6.1
      - tensorboard-plugin-wit==1.8.1
      - tifffile==2020.9.3
      - toml==0.10.2
      - tomli==1.2.3
      - torch==1.10.2
      - typed-ast==1.5.5
      - typing-extensions==4.1.1
      - typing-inspect==0.9.0
      - urllib3==1.26.20
      - werkzeug==2.0.3
      - zipp==3.6.0
prefix: /opt/conda/envs/MONAI

tests/test_data_statsd.py::TestDataStatsd::test_value_5
tests/test_data_statsd.py::TestDataStatsd::test_file_0
tests/test_data_statsd.py::TestDataStatsd::test_value_0 tests/test_data_statsd.py::TestDataStatsd::test_value_1 tests/test_data_statsd.py::TestDataStatsd::test_value_2 tests/test_data_statsd.py::TestDataStatsd::test_value_3 tests/test_data_statsd.py::TestDataStatsd::test_value_4
monai/transforms/utility/dictionary.py monai/transforms/utility/array.py
monai/transforms/utility/dictionary.py monai/transforms/utility/array.py