code: def main():
      parser = ArgumentParser(
          description=DESCRIP,
          epilog=EPILOG,
          formatter_class=RawDescriptionHelpFormatter,
      )
      parser.add_argument(
          "filename", type=str, help="4D image filename"
      )
      parser.add_argument(
          "--out-path", type=str, help="path for output image files"
      )
      args = parser.parse_args()
      out_path = args.out_path
      img = nib.load(args.filename)
      imgs = nib.four_to_three(img)
      froot, ext = splitext(args.filename)
      if ext in (".gz", ".bz2"):
          froot, ext = splitext(froot)
      if out_path is not None:
          pth, fname = psplit(froot)
          froot = pjoin(out_path, fname)
      for i, img3d in enumerate(imgs):
          fname3d = "%s_%04d.nii" % (froot, i)
          nib.save(img3d, fname3d)
  
imports: from argparse import ArgumentParser, RawDescriptionHelpFormatter
  from os.path import join
  from os.path import split
  from os.path import splitext
  import nibabel
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types