code: def get_rois_crossed(pointsmm, roiData, voxelSize):
      n_points = len(pointsmm)
      rois_crossed = []
      for j in range(0, n_points):
          # store point
          x = int(pointsmm[j, 0] / float(voxelSize[0]))
          y = int(pointsmm[j, 1] / float(voxelSize[1]))
          z = int(pointsmm[j, 2] / float(voxelSize[2]))
          if not roiData[x, y, z] == 0:
              rois_crossed.append(roiData[x, y, z])
      rois_crossed = list(
          dict.fromkeys(rois_crossed).keys()
      )  # Removed duplicates from the list
      return rois_crossed
  
imports: import pickle
  import os.path
  import numpy
  import nibabel
  import networkx
  from ...None import logging
  from ...utils.filemanip import split_filename
  from ..base import BaseInterface, BaseInterfaceInputSpec, traits, File, TraitedSpec, Directory, OutputMultiPath, isdefined
label_desc: Use image node_id 2 for calling a global function with example usage: get_rois_crossed(pointsmm, roiData, voxelSize) and returns: rois_crossed