
Since I can't search the web site, here is a question... I am using the following calls inside my C++ app: import_array(); a=PyRun_SimpleString("from image_module import *"); // my module for wrapping a C++ class a=PyRun_SimpleString("image=imagemanager()\n"); // load a new instance of the class into Python a=PyRun_SimpleString("a=image.GetImage(0)"); // assign image 0 to a Basically, GetImage() returns a numpy Array Object for image 0, properly initialized by PyArray_FromDimsAndData(). I can't return all the images because they might not be sequential in memory (off loaded to the filesystem). "a" appears to be an list of numbers. I am not sure if Python knows it is a PyArrayObject. This is where I am getting into trouble. I can't do something like a=PyRun_SimpleString("a = a + 100"); I get an error "Value Error: Function not Supported". I am trying to figure out what namespace did "import_array()" import Numeric into. Also, I am using _numpy_d.pyd that I compiled under Windows NT and MSVC 6.0. -- Cheers, Karl Bellve, Ph.D. ICQ # 13956200 Biomedical Imaging Group TLCA# 7938 University of Massachusetts Email: Karl.Bellve@umassmed.edu Phone: (508) 856-6514 Fax: (508) 856-1840 PGP Public key: finger kdb@molmed.umassmed.edu

Karl Bellve wrote:
I corrected a few things. First, I wasn't importing Numeric but just import_array (thanks to Pete Shinners). Although I am getting DLL collisions and relocations, it still works. I am able to do the following now: a=a+100. I need to figure out why I am getting the DLL collisions... -- Cheers, Karl Bellve

Karl Bellve wrote:
I corrected a few things. First, I wasn't importing Numeric but just import_array (thanks to Pete Shinners). Although I am getting DLL collisions and relocations, it still works. I am able to do the following now: a=a+100. I need to figure out why I am getting the DLL collisions... -- Cheers, Karl Bellve
participants (1)
-
Karl Bellve