[Matrix-SIG] bitwise combos of arrays?

Heather Drury heather@v1.wustl.edu
Wed, 11 Aug 1999 12:31:19 -0500 (CDT)


Hi,

I'm trying to combine 16 binary volumes (10 meg each) into one 16-bit
volume. For each of the 16 volumes, the output volume would have the
appropriate bit set. In other words, if for voxel "idx" only the 1st,
4th, and 9th volumes had an entry of 255 for voxel "idx" the output
voxel at idx would be 0000000100001001.

The pseudocode for this would look approximately like:

	create output volume
	for j = 0; j < 16; j++ 
		read jth volume
		for all voxels in volume
			if voxel [idx] == 255
				currentvoxel = output [idx]
				adjust output [idx] so jth bit is set
			endif
		end
	end

Normally, I would do this in "c" (my brain is just coded that way), but
I'm trying to use python for more and more programming.  So, I have 
a couple of questions:

	- Where is the most recent NumPy documentation?
	- Can I do this kind of thing in python/NumPy?
	- Can someone point me in the right direction?

TIA,

Heather			

Heather Drury                               	heather@v1.wustl.edu 
Washington University School of Medicine    	http://v1.wustl.edu	
Department of Anatomy & Neurobiology         	Phone: 314-362-4325
660 S. Euclid, MS 8108                       	FAX: 314-747-4370
St. Louis, MO 63110-1093