Is there a way to import a string of bytes (from disk or memory) directly into an Image[] object, for efficient use of memory during object construction?
Background:
I have an image on disk in flat binary format. It is a sequence of unsigned 16-bit integers, stored row-major.
When I import that data into a Mathematica String, the string length is 968,000,000 with a ByteCount of 1,284,086,240.
When I import "UnsignedInteger16"s from that string, the ByteCount of the result increases to 3,872,000,144.
When I convert that set of UnsignedInteger16's into an image (first partitioned into rows of 22,000 samples), the ByteCount of the image drops to 968,000,400. That number looks like the original string length, with some additional metadata. Hence my question for a more direct approach to Image construction.
Thanks,
Vince