class_docstr: Cross validation dataset based on the general dataset which must have `_split_datalist` API.
  
  Args:
      dataset_cls: dataset class to be used to create the cross validation partitions.
          It must have `_split_datalist` API.
      nfolds: number of folds to split the data for cross validation.
      seed: random seed to randomly shuffle the datalist before splitting into N folds, default is 0.
      dataset_params: other additional parameters for the dataset_cls base class.
  
  Example of 5 folds cross validation training::
  
      cvdataset = CrossValidation(
          dataset_cls=DecathlonDataset,
          nfolds=5,
          seed=12345,
          root_dir="./",
          task="Task09_Spleen",
          section="training",
          transform=train_transform,
          download=True,
      )
      dataset_fold0_train = cvdataset.get_dataset(folds=[1, 2, 3, 4])
      dataset_fold0_val = cvdataset.get_dataset(folds=0, transform=val_transform, download=False)
      # execute training for fold 0 ...
  
      dataset_fold1_train = cvdataset.get_dataset(folds=[0, 2, 3, 4])
      dataset_fold1_val = cvdataset.get_dataset(folds=1, transform=val_transform, download=False)
      # execute training for fold 1 ...
  
      ...
  
      dataset_fold4_train = ...
      # execute training for fold 4 ...
class_docstr_tok: ["Cross","validation","dataset","based","on","the","general","dataset","which","must","have","`","_split_datalist","`","API",".","Args",":","dataset_cls",":","dataset","class","to","be","used","to","create","the","cross","validation","partitions",".","It","must","have","`","_split_datalist","`","API",".","nfolds",":","number","of","folds","to","split","the","data","for","cross","validation",".","seed",":","random","seed","to","randomly","shuffle","the","datalist","before","splitting","into","N","folds",",","default","is","0.","dataset_params",":","other","additional","parameters","for","the","dataset_cls","base","class",".","Example","of","5","folds","cross","validation","training",":",":","cvdataset","=","CrossValidation","(","dataset_cls=DecathlonDataset",",","nfolds=5",",","seed=12345",",","root_dir=","''",".\/","''",",","task=","''","Task09_Spleen","''",",","section=","''","training","''",",","transform=train_transform",",","download=True",",",")","dataset_fold0_train","=","cvdataset.get_dataset","(","folds=","[","1",",","2",",","3",",","4","]",")","dataset_fold0_val","=","cvdataset.get_dataset","(","folds=0",",","transform=val_transform",",","download=False",")","#","execute","training","for","fold","0","...","dataset_fold1_train","=","cvdataset.get_dataset","(","folds=","[","0",",","2",",","3",",","4","]",")","dataset_fold1_val","=","cvdataset.get_dataset","(","folds=1",",","transform=val_transform",",","download=False",")","#","execute","training","for","fold","1","...","...","dataset_fold4_train","=","...","#","execute","training","for","fold","4","..."]
code: def __init__(
      self,
      dataset_cls: object,
      nfolds: int = 5,
      seed: int = 0,
      **dataset_params: Any,
  ) -> None:
      if not hasattr(dataset_cls, "_split_datalist"):
          raise ValueError(
              "dataset class must have _split_datalist API."
          )
      self.dataset_cls = dataset_cls
      self.nfolds = nfolds
      self.seed = seed
      self.dataset_params = dataset_params
  
imports: from __future__ import annotations
  import os
  import shutil
  import sys
  import warnings
  from collections.abc import Callable, Sequence
  from pathlib import Path
  from typing import Any
  import numpy
  from monai.apps.tcia import DCM_FILENAME_REGEX, download_tcia_series_instance, get_tcia_metadata, get_tcia_ref_uid, match_tcia_ref_uid_in_study
  from monai.apps.utils import download_and_extract
  from monai.config.type_definitions import PathLike
  from monai.data import CacheDataset, PydicomReader, load_decathlon_datalist, load_decathlon_properties, partition_dataset, select_cross_validation_folds
  from monai.transforms import LoadImaged, Randomizable
  from monai.utils import ensure_tuple
label_desc: Use image node_id 1 to create a new CrossValidation object  with example: obj = CrossValidation(dataset_cls, nfolds, seed)