Custom distance with FLANN

Is there a way to define our own distance for FLANN tool in OpenCV.