code: def process_plans(self, plans):
      if self.stage is None:
          assert len(list(plans["plans_per_stage"].keys())) == 1, (
              "If self.stage is None then there can be only one stage in the plans file. That seems to not be the "
              "case. Please specify which stage of the cascade must be trained"
          )
          self.stage = list(plans["plans_per_stage"].keys())[0]
      self.plans = plans
  
      stage_plans = self.plans["plans_per_stage"][self.stage]
      self.batch_size = stage_plans["batch_size"]
      self.net_pool_per_axis = stage_plans["num_pool_per_axis"]
      self.patch_size = np.array(stage_plans["patch_size"]).astype(int)
      self.do_dummy_2D_aug = stage_plans["do_dummy_2D_data_aug"]
  
      if "pool_op_kernel_sizes" not in stage_plans.keys():
          assert "num_pool_per_axis" in stage_plans.keys()
          print(
              "WARNING! old plans file with missing pool_op_kernel_sizes. Attempting to fix it..."
          )
          self.net_num_pool_op_kernel_sizes = []
          for i in range(max(self.net_pool_per_axis)):
              curr = []
              for j in self.net_pool_per_axis:
                  if (max(self.net_pool_per_axis) - j) <= i:
                      curr.append(2)
                  else:
                      curr.append(1)
              self.net_num_pool_op_kernel_sizes.append(curr)
      else:
          self.net_num_pool_op_kernel_sizes = stage_plans[
              "pool_op_kernel_sizes"
          ]
  
      if "conv_kernel_sizes" not in stage_plans.keys():
          print(
              "WARNING! old plans file with missing conv_kernel_sizes. Attempting to fix it..."
          )
          self.net_conv_kernel_sizes = [
              [3] * len(self.net_pool_per_axis)
          ] * (max(self.net_pool_per_axis) + 1)
      else:
          self.net_conv_kernel_sizes = stage_plans["conv_kernel_sizes"]
  
      self.pad_all_sides = None
      self.intensity_properties = plans["dataset_properties"][
          "intensityproperties"
      ]
      self.normalization_schemes = plans["normalization_schemes"]
      self.base_num_features = plans["base_num_features"]
      self.num_input_channels = plans["num_modalities"]
      self.num_classes = plans["num_classes"] + 1
  
      self.classes = plans["all_classes"]
      self.use_mask_for_norm = plans["use_mask_for_norm"]
      self.only_keep_largest_connected_component = plans[
          "keep_only_largest_region"
      ]
      self.min_region_size_per_class = plans[
          "min_region_size_per_class"
      ]
      self.min_size_per_class = None
  
      if (
          plans.get("transpose_forward") is None
          or plans.get("transpose_backward") is None
      ):
          print(
              "WARNING! You seem to have data that was preprocessed with a previous version of nnU-Net. "
              "You should rerun preprocessing. We will proceed and assume that both transpose_foward "
              "and transpose_backward are [0, 1, 2]. If that is not correct then weird things will happen!"
          )
          plans["transpose_forward"] = [0, 1, 2]
          plans["transpose_backward"] = [0, 1, 2]
      self.transpose_forward = plans["transpose_forward"]
      self.transpose_backward = plans["transpose_backward"]
  
      if len(self.patch_size) == 2:
          self.threeD = False
      elif len(self.patch_size) == 3:
          self.threeD = True
      else:
          raise RuntimeError(
              "invalid patch size in plans file: %s"
              % str(self.patch_size)
          )
  
      if "conv_per_stage" in plans.keys():
          self.conv_per_stage = plans["conv_per_stage"]
      else:
          self.conv_per_stage = 2
  
imports: import os
  import pickle
  import glob
  import json
  import numpy
  from multiprocessing import Pool
  from collections import OrderedDict
  from sklearn.model_selection import KFold
  from typing import List
  from medicalseg.datasets import MedicalDataset
  from medicalseg.cvlibs import manager
  from nnunet.transforms import get_moreDA_augmentation, default_2D_augmentation_params, default_3D_augmentation_params
  from nnunet.transforms import rotate_coords_3d, rotate_coords_2d, NumpyToTensor
  from .dataloader import DataLoader2D, DataLoader3D
  from tools.preprocess_utils import verify_dataset_integrity, convert_to_decathlon, crop, ExperimentPlanner2D_v21, ExperimentPlanner3D_v21, DatasetAnalyzer
label_desc: Use image node_id 9 for calling the MSDDataset obj's underlying member method code with example usage: obj.process_plans(plans) without return types