code: def split_files_txt(
      self,
      txt,
      image_files,
      label_files=None,
      split=None,
      testsplit=None,
  ):
      split = int(split * len(image_files))
      testsplit = int(testsplit * len(image_files))
      if "train" in txt:
          image_names = image_files[:split]
          label_names = label_files[:split]
      elif "val" in txt:
          # set the valset to 20% of images if all files need to be used in training
          image_names = image_files[split:testsplit]
          label_names = label_files[split:testsplit]
      elif "test" in txt:
          image_names = image_files[testsplit:]
          label_names = label_files[testsplit:]
      else:
          raise NotImplementedError(
              "The txt split except for train.txt, val.txt and test.txt is not implemented yet."
          )
      self.write_txt(txt, image_names, label_names)
  
file_path: PaddleSeg/contrib/MedicalSeg/tools/prepare_msd_brain_seg.py
imports: import os
  import os.path
  import sys
  import time
  import numpy
  import nibabel
  import SimpleITK
  from tqdm import tqdm
  from prepare import Prep
  from tools.preprocess_utils import join_paths
label_desc: Use image node_id 3 for calling the PrepMSDBrain obj's underlying member method code with example usage: obj.split_files_txt(txt, image_files, label_files, split, testsplit) without return types