fixed bug in calc_lut that occured if kdTree was not intialized