code: def split_4d_to_3d_and_save(
      img_itk: sitk.Image, output_folder, file_base_name
  ):
      slicer = sitk.ExtractImageFilter()
      s = list(img_itk.GetSize())
      s[-1] = 0
      slicer.SetSize(s)
      for i, slice_idx in enumerate(range(img_itk.GetSize()[-1])):
          slicer.SetIndex([0, 0, 0, slice_idx])
          sitk_volume = slicer.Execute(img_itk)
          sitk.WriteImage(
              sitk_volume,
              join_paths(
                  output_folder,
                  file_base_name[:-7] + "_%04.0d.nii.gz" % i,
              ),
          )
  
file_path: PaddleSeg/contrib/MedicalSeg/tools/preprocess_utils/convert_to_decathlon.py
imports: import os
  import shutil
  import numpy
  import SimpleITK
  from multiprocessing import Pool
  from .path_utils import join_paths
label_desc: Use image node_id 3 for calling a global function with example usage: split_4d_to_3d_and_save(img_itk, output_folder, file_base_name) without return types