reading Nanotec WSxM binary files
ibo
Generally, I don't see many ways to load a binary image into Igor; I see a way to load a XY dataset as a matrix, or a general binary file as a 1D wave, but that's it.
I attached a binary file for reference, it has two images in it (note I added '.txt' so I could upload it). Information on the file format, apparently, is here:
http://www.nanotec.es/products/wsxm/file_structure.php
Thanks,
MJ Matthews
I opened your file in a text editor and noted that there is *LOTS* of ascii header information. I copied that header info, pasted it into a new file and saved it. There are 11220 bytes in the file, so my first guess at the header size is 11220. I used this command to load the binary part of the file into a wave:
/T says to load 16-bit unsigned integers from the file. It is possible that it should be unsigned.
/S tells GBLoadWave to skip 11220 bytes at the start.
/W says there is just one array in the file
/B tells GBLoadWave that the file is in Intel byte order.
The result was a wave with reasonable-looking numbers and a bunch of zeroes at the start. I edited the zeroes out, and got a number of data points that is exactly the square of 512! So then I did this:
to make the wave into a 512x512 matrix. The resulting image is attached in PNG format.
You could probably write a procedure using Open and FReadLine to read information from the ascii header.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
October 18, 2010 at 04:57 pm - Permalink
I also forgot to mention that the file path is, of course, unique to my machine... You don't have to type this in- I generated the command from the dialog you get when you choose Data->Load Waves->Load General Binary File.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
October 18, 2010 at 05:06 pm - Permalink