enliteneer@mindless.com wrote:
> Hi,
>
> Im trying to Display a black and white 320 x 240
> image file.
>
> My approach was to read a Binary File, and
> send it through a "Build Array" Component, and
> then finally route it to an Intensity Chart.
>
> The display, however, looks nothing like it
> should (its NOT in black and white, and its just
> straight lines everywhere).
You may be running into several issues here. If your source image file
really is a standard image format, then there's going to be a header
portion that defines the characteristics of the image and specifies the
structure of the data to follow. By the sound of your message, I'd
guess that your files don't have any header info and are simply a block
of (320 x 240 x 2 bytes/pixel=) 153,600 bytes of pi
xel value data. If
your files are larger, then you probably do have a header, and you'll
need to skip that information before reading into your array.
Assuming no header, you should be able to use "Read File," specifying a
byte stream type of U16 and a count of 76,800. You would wire the
output array into a "Reshape Array" node, making sure to add a dimension
so that that you get a 2D output, and wiring a 240 and a 320 into the
dimension size inputs. The output should connect right up to an
intensity graph that adapts to display the 16-bit values.
The last piece of the puzzle will involve adjusting the bounds of the
color ramp of the intensity graph to correspond to your desired min and
max values (probably 0 and 2^16) and setting the colors in the ramp--you
can do this with the "Color Array" attribute of the intensity graph.
You may also need to rotate or transpose the image array to achieve the
orientation that you want in the graph.
Best of Luck,
John Lum