04-30-2009 10:07 AM
I have data files(images): 2 32-bit numbers followed by sequential 16 bits binary numbers.
Now I want to convert it to other format files(such as tiff, jpg, txt and so on) which can be open by other software?
How to do it? By the way, attached is a file with an .bis extension.
Thanks,
Peter
04-30-2009 10:19 AM
No attachment...
What do the numbers represent?
04-30-2009 11:00 AM
Thanks for the quick response.
I guess that is the file format.
In fact the application software was writen by other guys. So I am not quite sure of the file.
The file is an intensity image binary file:( 512X512 pixels, and on every pixel, there is a number stands for the intensity.
Then the pixel is the x and y coordinate). So the data is a 512X512 number matrix. Due the file with bis entension name can not be attached, I changed the extension name to txt from bis.
04-30-2009 01:26 PM - edited 04-30-2009 01:26 PM
Are you sure about those being 16-bit numbers? The first 8 bytes are indeed 2 32-bit numbers referring to the X, Y dimensions (in this case 512x512). If the rest of the data is interpreted as 16-bit numbers I get 0, 30, 0, 26, 0, 23, 0, 26, ... This tells me that they're actually 32-bit numbers so that you get 30, 26, 23, 26 for an array of 262144 (which is 512x512). Plotting these on an intensity chart I get this, which sort of looks like an image:
Does this look right?
04-30-2009 07:54 PM
Thanks.
It seems that iamge you got is right. How did you get this? I can not open the file that is just a knid of fig.
Just the x and y coordinate is not 512X512 pixel. And there is not the black edge in the real image.
Peter
04-30-2009 08:26 PM - edited 04-30-2009 08:27 PM
The black border is simply due to the fact that the X and Y scale on the intensity chart is set to 600 due to autoscaling. It's not really there.
As for reading the file I just read the file as an array of 32-bit integers. As I indicated, I don't think the values after the first 2 32-bit numbers are 16-bit values. Basically, all I did was this:
05-01-2009 06:32 AM
05-01-2009 08:53 AM
05-01-2009 09:42 AM - edited 05-01-2009 09:43 AM
The picture is on the dark side. All bits are just a variation of the theme pitch black ;). So something is wrong no doubt.
05-01-2009 11:03 PM
In fact, I didn't change the file anywhere.
What I did is before the attachement of this file I change the extension name to txt because the extension .bis file can not be attached here.
peter