code: def create_new_dataset_json(
      modality: str,
      num_foreground_classes: int,
      num_input_channels: int,
      num_training_data: int,
      output_filepath: str,
  ) -> None:
      """
      Create a new copy of dataset .json to meet the requirements of nnU-Net V2
  
      Args:
          modality: image modality, could a string or a list of strings.
          num_foreground_classes: number of foreground classes.
          num_input_channels: number of input (image) channels.
          num_training_data: number of training data.
          output_filepath: output file path/name.
      """
      new_json_data: dict = {}
  
      # modality = self.input_info.pop("modality")
      modality = ensure_tuple(modality)  # type: ignore
  
      new_json_data["channel_names"] = {}
      for _j in range(num_input_channels):
          new_json_data["channel_names"][str(_j)] = modality[_j]
  
      new_json_data["labels"] = {}
      new_json_data["labels"]["background"] = 0
      for _j in range(num_foreground_classes):
          new_json_data["labels"][f"class{_j + 1}"] = _j + 1
  
      # new_json_data["numTraining"] = len(datalist_json["training"])
      new_json_data["numTraining"] = num_training_data
      new_json_data["file_ending"] = ".nii.gz"
  
      ConfigParser.export_config_file(
          config=new_json_data,
          # filepath=os.path.join(raw_data_foldername, "dataset.json"),
          filepath=output_filepath,
          fmt="json",
          sort_keys=True,
          indent=4,
          ensure_ascii=False,
      )
  
      return
  
file_path: MONAI/monai/apps/nnunet/utils.py
imports: from __future__ import annotations
  import copy
  import os
  import numpy
  import monai
  from monai.bundle import ConfigParser
  from monai.utils import StrEnum, ensure_tuple, optional_import
label_desc: Use image node_id 3 for calling a global function with example usage: create_new_dataset_json(modality, num_foreground_classes, num_input_channels, num_training_data, output_filepath) without return types