From: Alexandre G. <ale...@mi...> - 2006-06-08 11:43:44
|
Hi all. =20 i work mainly with "volume" (3d) images, and numpy.ndarray answers most of my needs (addition of images, etc.). The problem I'm faced now with is that I have images of matrices and vectors and would like that when I do image_of_matrices * image_of_vector is does the dot product of each of my matrices with all of my vectors, and when I do image_of_matrices.mean() it gives me the mean matrix. Basically, I want the same functionalities that are currently provided with scalars, but applied to matrices. =20 It seems that a nice way of doing this is to have and ndarray of numpy.matrix, but this isn't supported it seems. Can anyone recommend a good way of implementing this? I'm new with the numpy thing and I'm not sure if subclassing ndarray is a good idea since I'll have to overload all the operators and i don't believe this will result in a very fast implementation, but I might be mistaken. Another possibility may be to create a new dtype for numpy.matrix, but I don't know if this is possible. Anyone have recommandations? =20 Thx for any help. =20 Alex. NOTICE: This e-mail message and all attachments=0Atransmitted with it may= contain legally privileged and=0Aconfidential information intended solel= y for the use of=0Athe addressee. If the reader of this message is not th= e=0Aintended recipient, you are hereby notified that any=0Areading, disse= mination, distribution, copying, or other=0Ause of this message or its at= tachments, hyperlinks, or=0Aany other files of any kind is strictly prohi= bited. If you=0Ahave received this message in error, please notify the=0A= sender immediately by telephone (+44-1865-265500) or by=0Aa reply to this= electronic mail message and delete this=0Amessage and all copies and bac= kups thereof.=0A |