how to create a script-based terrain in unity

This is for scientific project. I have file from AFM (atomic force microscope), so it’s like height (h) values for x,y coordinates (map file in .txt), like a terrain in Unity. So I need recreate this AFM image as a Unity terrain to have possibility work with later.
Here is an example of this kind of images

you can generate bitmap

Unity - Scripting API: Texture2D.SetPixel (or pixels or pixels32)

from the text files and use them as alucardj suggest

(Unity Reference Documentation :
scroll down to Working with Heightmaps :

or you can generate mesh from them

however it would be nice to see the format of those text files