code: def collectPaths(in_dir):
      paths = []
      for path, dirs, files in os.walk(in_dir):
          pet_files = [f for f in files if "lsa_pet" in f]
          if len(files) > 0 and "TNM" in path and len(pet_files) > 0:
              paths.append(path)
  
      return paths
  
file_path: medicaldetectiontoolkit/experiments/pet_ct_tnm_classification/preprocessing.py
imports: import os
  import SimpleITK
  import numpy
  from multiprocessing import Pool
  import pandas
  import numpy.testing
  from skimage.transform import resize
  import subprocess
  from scipy.ndimage.measurements import label
  from scipy.ndimage.measurements import center_of_mass
  import nrrd
  from copy import deepcopy
  from skimage.segmentation import clear_border
  import configs
label_desc: Use image node_id 3 for calling a global function with example usage: collectPaths(in_dir) and returns: paths