code: def save_csv_array(filefolder, filename, array_to_save):
      """
      Save a np array as a csv
      :param filefolder: Path to the folder where to save
      :param filename: Name of the file to save
      :param array_to_save: Array to save
      :return:
      """
      if array_to_save is None:
          return
      if not isinstance(array_to_save, pd.DataFrame):
          array_to_save = pd.DataFrame(array_to_save)
      touch_folder(filefolder)
      output_name = os.path.join(filefolder, filename)
      try:
          if os.path.isfile(output_name):
              tf.logging.warning(
                  "File %s exists, overwriting the file.", output_name
              )
          array_to_save.to_csv(output_name)
      except OSError:
          tf.logging.fatal("writing failed {}".format(output_name))
          raise
      tf.logging.info("Saved {}".format(output_name))
  
imports: from __future__ import absolute_import, print_function, unicode_literals
  import errno
  import importlib
  import logging
  import os
  import re
  import sys
  import warnings
  import nibabel
  import numpy
  import pandas
  import scipy.ndimage
  import tensorflow
  from tensorflow.core.framework import summary_pb2
  from niftynet.io.image_loader import load_image_obj
  from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig
  from niftynet.utilities.util_import import require_module
label_desc: Use image node_id 11 for calling a global function with example usage: save_csv_array(filefolder, filename, array_to_save) without return types