Re: 1 bit deemp bitmap images [message #9114] |
Tue, 03 June 1997 00:00 |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
wrote:
>
> I am trying to display a bitmap file transfered from a
> Lecroy Oscilloscope. Unfortunately the bitmap file is only
> 1 bit deep. Does anybody have a read_bmp.pro type procedure
> to handle this?
>
> Any information concerning this matter would be greatly
> appreciated.
Sorry I don't have time to work out the details, but here is how
I would go about solving this. First, I'll assume that both
dimensions of the image are divisible by 8.
As an example, say you have a 1-bit image that is (128,128), or
16384 bits, or 2048 bytes. The steps would be:
1. Read the image into a BYTARR(2048), call it IMG. I'm also
assuming that the image is stored by rows.
2. Do some bit and vector manipulations so you
end up with an array BITS = BYTARR(8,2048), such that
BITS[*,i] represents the 8 bits in the byte IMG[i] .
3. IMG_NEW = reform( BITS,128,128 ) ; Your BYTARR(128,128)
I realize that step #2 is the interesting part.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
"I have this theory that if we're told we're bad,
then that's the only idea we'll ever have.
But maybe if we are surrounded in beauty,
someday we will become what we see." - Jewel Kilcher
|
|
|