If you want to convert the values of each pixel to grayscale, you should use image processing libraries such as OpenCV or Scikit-image. Also with these libraries you can visualize the data of each pixel in a matrix way.
Does these libraries extract the RGB M*N*3 matrix for the given thermal image? Yes.
I recommend you that first explore your data. Data from advanced thermal cameras consist of RGB image and 1 extra dimension for thermal information. So if you have the complete data (4-dim) you can use the libraries to get pixel values from any dimension you want.
On the other hand, if you have just a matrix with the values (the extra dimension) standing for temperature for each pixel, you can plot a new grayscale image.