<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I did the make install, and put in "import BufferConversion" and it worked. As I had guessed, the problem was my newbie python ignorance.<div><br></div><div>Thanks for the help.</div><div><br></div><div>Dave</div><div><br><div><div>On Jun 20, 2011, at 7:02 PM, Gaëtan Lehmann wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>Hi David,<br><br>The simplest solution is probably to install PyBuffer, by running "make install".<br>The PyBuffer class is then available directly in the itk module:<br><br> itk.PyBuffer<br><br>If you don't have the rights required for the nistallation, then you'll have to add the path where the binaries are to your PYTHONPATH, as well as the path to the BufferConversion.py file.<br>Something like:<br><br> export PYTHONPATH=$PWD/lib:$PWD/Languages/Python/<br><br>then you should be able to import BufferConversion.<br><br>Please let us know if that fix your problem.<br><br>Gaëtan<br><br><br>Le 20 juin 11 à 20:26, David Chen a écrit :<br><br><blockquote type="cite">I'm trying to build and use the PyBuffer external project in WrapITK. I think I've built it ok, but when I try and run a test script, here's the error I get:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">puget => test.py<br></blockquote><blockquote type="cite">Traceback (most recent call last):<br></blockquote><blockquote type="cite"> File "test.py", line 4, in <module><br></blockquote><blockquote type="cite"> import itkPyBufferPython<br></blockquote><blockquote type="cite"> File "itkPyBufferPython.py", line 28, in <module><br></blockquote><blockquote type="cite"> _itkPyBufferPython = swig_import_helper()<br></blockquote><blockquote type="cite"> File "itkPyBufferPython.py", line 20, in swig_import_helper<br></blockquote><blockquote type="cite"> import _itkPyBufferPython<br></blockquote><blockquote type="cite">ImportError: No module named _itkPyBufferPython<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">This is my simple test script:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">#!/usr/bin/env python<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">import itk<br></blockquote><blockquote type="cite">import itkPyBufferPython<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">pixelType = itk.UC<br></blockquote><blockquote type="cite">imageType = itk.Image[pixelType, 2]<br></blockquote><blockquote type="cite">connector = itk.PyBuffer[imageType]<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I am running the script in the lib sub-directory of my build directory.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">David T. Chen, PhD [Lockheed Martin contractor]<br></blockquote><blockquote type="cite"><a href="mailto:dchen@mail.nih.gov">mailto:dchen@mail.nih.gov</a> <a href="http://erie.nlm.nih.gov/~dave">http://erie.nlm.nih.gov/~dave</a><br></blockquote><blockquote type="cite">phone:301.435.3264 iphone:301.524.3174<br></blockquote><blockquote type="cite">Office of High Performance Computing and Communications<br></blockquote><blockquote type="cite">National Library of Medicine<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_____________________________________<br></blockquote><blockquote type="cite">Powered by <a href="http://www.kitware.com">www.kitware.com</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Visit other Kitware open-source projects at<br></blockquote><blockquote type="cite"><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Kitware offers ITK Training Courses, for more information visit:<br></blockquote><blockquote type="cite"><a href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Please keep messages on-topic and check the ITK FAQ at:<br></blockquote><blockquote type="cite"><a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Follow this link to subscribe/unsubscribe:<br></blockquote><blockquote type="cite"><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote><br>-- <br>Gaëtan Lehmann<br>Biologie du Développement et de la Reproduction<br>INRA de Jouy-en-Josas (France)<br>tel: +33 1 34 65 29 66 fax: 01 34 65 29 09<br><a href="http://mima2.jouy.inra.fr">http://mima2.jouy.inra.fr</a> <a href="http://www.itk.org">http://www.itk.org</a><br><a href="http://www.bepo.fr">http://www.bepo.fr</a><br><br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px; ">David T. Chen, PhD [Lockheed Martin contractor]</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px; "><a href="mailto:dchen@mail.nih.gov">mailto:dchen@mail.nih.gov</a> <a href="http://erie.nlm.nih.gov/~dave">http://erie.nlm.nih.gov/~dave</a></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px; ">phone:301.435.3264 iphone:301.524.3174</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px; ">Office of High Performance Computing and Communications</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px; ">National Library of Medicine</span></font></div></div></div></span></span>
</div>
<br></div></body></html>