[Insight-users] ITK v4 & Python - WrapITK

Ahmed Halaweish, Ph.D. ahmed.halaweish at duke.edu
Thu Jul 19 11:29:54 EDT 2012


Brad,
   I'm running v4.1. The full error is " from InsightToolkit import *, ImportError: No module named InsightToolkit ". I have already tried the new DicomSliceRead.py example and the same error occurs. With regards to the PYTHONPATH, I was under the impression that modifying the DYLD_LIBRARY_PATH took care of this. Is there another way of setting this that I missed? I'm still new to this python world, so bear with me :D.

Cheers

Ahmed F. Halaweish Ph.D.


From: Bradley Lowekamp <blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>>
Date: Thursday, July 19, 2012 11:23 AM
To: Ahmed Halaweish <ahmed.halaweish at dm.duke.edu<mailto:ahmed.halaweish at dm.duke.edu>>
Cc: "insight-users at itk.org<mailto:insight-users at itk.org>" <insight-users at itk.org<mailto:insight-users at itk.org>>
Subject: Re: [Insight-users] ITK v4 & Python - WrapITK

Hello,

What version of ITK are you using?

What is the complete error message you are getting??

Did you set your PYTHONPATH too?

The current version of the example does not do an "import InsightToolkit", I believe that the example has been updated to use WrapITK from using a quite old wrapping system recently. This is the current file:

github.com/Kitware/ITK/blob/master/Examples/IO/DicomSliceRead.py<http://github.com/Kitware/ITK/blob/master/Examples/IO/DicomSliceRead.py>

Brad

On Jul 19, 2012, at 10:27 AM, Ahmed Halaweish, Ph.D. wrote:

I have finally managed to get ITKv4 w/WrapITK compiled on my Mac OSX (Lion 10.7.4, python 2.7). Now when I try to run the DicomSliceRead.py example, I keep getting the following error: "ImportError: No module named InsightToolkit". I have set the DYLD_LIBRARY_PATH to the ITK build directory and I still get the same errors.

During compiling process, These are the variables I set:
BUILD TESTING: OFF
BUILD EXAMPLES: OFF
ITK USE REVIEW: ON
ITK WRAPPING: ON
ITK WRAP PYTHON: ON
ITK WRAP JAVA: ON

I also tested the helloworld.cxx program and it worked fine, so it must be something with the python wrapping variables. Any help is greatly appreciated.

Cheers

Ahmed F. Halaweish

_____________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


========================================================

Bradley Lowekamp

Medical Science and Computing for

Office of High Performance Computing and Communications

National Library of Medicine

blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120719/abcf6473/attachment-0001.htm>


More information about the Insight-users mailing list