code: def __init__(
      self,
      plans_name=None,
      num_batches_per_epoch=250,
      fold=0,
      dataset_directory=None,
      raw_data_dir=None,
      decathlon_dir=None,
      cropped_data_dir=None,
      preprocessed_dir=None,
      plan2d=False,
      plan3d=False,
      stage=None,
      cascade=False,
      dataset_root=None,
      result_dir=None,
      use_multi_augmenter=True,
      transforms=None,
      num_classes=None,
      unpack_data=True,
      mode="train",
      ignore_index=255,
      num_threads=4,
  ):
      self.raw_data_dir = raw_data_dir
      self.decathlon_dir = decathlon_dir
      self.cropped_data_dir = cropped_data_dir
      self.num_threads = num_threads
      self.plan2d = plan2d
      self.plan3d = plan3d
      self.preprocessed_dir = preprocessed_dir
      self.preprocess_and_generate_plans()
      self.cascade = cascade
      self.use_multi_augmenter = use_multi_augmenter
  
      self.folder_with_segs_from_prev_stage = os.path.join(
          preprocessed_dir, "pred_next_stage"
      )
  
      self.dataset_directory = preprocessed_dir
      self.unpack_data = unpack_data
      self.stage = stage
  
      self.fold = fold
      self.num_batches_per_epoch = num_batches_per_epoch
      self.plans_path = os.path.join(self.preprocessed_dir, plans_name)
      self.dataset_root = dataset_root
      self.result_dir = result_dir
      self.file_list = list()
      self.mode = mode.lower()
      self.ignore_index = ignore_index
  
      self.oversample_foreground_percent = 0.33
      self.pin_memory = True
      self.initialize()
  
      self.convert_to_tensor = NumpyToTensor(
          ["data", "target"], "float32"
      )
  
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 1 to create a new MSDDataset object from inherited base classes: MedicalDataset with example: obj = MSDDataset(plans_name, num_batches_per_epoch, fold, dataset_directory, raw_data_dir, decathlon_dir, cropped_data_dir, preprocessed_dir, plan2d, plan3d, stage, cascade, dataset_root, result_dir, use_multi_augmenter, transforms, num_classes, unpack_data, mode, ignore_index, num_threads)