[ITK] [ITK-users] Using ITK with python wrapping
Matt McCormick
matt.mccormick at kitware.com
Thu May 5 10:12:06 EDT 2016
Hello Aude,
Welcome to ITK!
The directory containing the ITK DLL files needs to be added to the
PATH environmental variable on Windows. For more information, see the
Wrapping section of the ITK Software Guide:
https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch3.html#x34-410003.7
As of ITK 4.10, this will no longer be necessary if BUILD_SHARED_LIBS
is OFF in the CMake configuration.
Hope this helps,
Matt
On Wed, May 4, 2016 at 10:15 AM, CHENET Aude (External)
<Aude.CHENET-ext at galderma.com> wrote:
> Hello
>
>
>
> I’ve built ITK 4.9 with Python wrapping. Compilation is OK.
>
> I tried to use ITK in my python code :
>
>
>
> import itk
>
> pixelType = itk.UC
>
> imageType = itk.Image[pixelType,2]
>
> readerType = itk.ImageFileReader[imageType]
>
> reader = readerType.New()
>
> reader.SetFileName(‘test.tif’)
>
>
>
> There is the following error :
>
>
>
> Traceback (most recent call last):
>
> File "C:\test.py", line 12, in <module>
>
> imageType = itk.Image[pixelType,2]
>
> File "C:\Python27\Lib\site-packages\itkLazy.py", line 42, in
> __getattribute__
>
> itkBase.LoadModule(module, namespace)
>
> File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule
>
> LoadModule(dep, namespace)
>
> File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule
>
> LoadModule(dep, namespace)
>
> File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule
>
> LoadModule(dep, namespace)
>
> File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule
>
> LoadModule(dep, namespace)
>
> File "C:\Python27\Lib\site-packages\itkBase.py", line 128, in LoadModule
>
> module = loader.load(swigModuleName)
>
> File "C:\Python27\Lib\site-packages\itkBase.py", line 245, in load
>
> return imp.load_module(name, fp, pathname, description)
>
> File "C:\Python27\Lib\site-packages\itk\ITKCommonPython.py", line 32, in
> <module>
>
> _ITKCommonPython = swig_import_helper()
>
> File "C:\Python27\Lib\site-packages\itk\ITKCommonPython.py", line 28, in
> swig_import_helper
>
> _mod = imp.load_module('_ITKCommonPython', fp, pathname, description)
>
> ImportError: DLL load failed: Le module spécifié est introuvable.
>
>
>
>
>
> Can someone help me to use itk in my code?
>
>
>
> Aude
>
>
> _____________________________________
> Powered by 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://public.kitware.com/mailman/listinfo/insight-users
>
_____________________________________
Powered by 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://public.kitware.com/mailman/listinfo/insight-users
More information about the Community
mailing list