[ITK] [ITK-users] ITK Python wrapping
D'Isidoro Fabio
fisidoro at ethz.ch
Sat Aug 22 03:02:28 EDT 2015
I am a newbie, trying to use ITK with Python wrapping on Windows 7. Using the short ITKSoftwareGuide, but could not find a comprehensive guide to use Python wrappers for dummies.
My problem is: I can't make the Python wrapping work. I can import itk with no errors when running Python in the new virtual environment configured inside my ITK build directory. But:
- As in this example (http://www.vtk.org/Wiki/ITK/Release_4/Wrapping/Examples) , I get no error for "PixelType = itk.UC" but when trying "ImageType = itk.Image[ImageType, 2]" I get the error1 in attachment (no module named _ITKPyBasePython ... something related to SWIG, that I don't have). Do I need to install Swig? (In a similar question in the iTK Wiki page the answer was: you will need the ITKv4 wrapping to use this example ... ?)
- Seemingly, in the new virtual env I try to run "python ImageRegistration3.py BrainProtonDensitySliceBorder20.png BrainProtonDensitySliceShifted13x17y.png output_image" in attachment (modified from the Examples folder with proper inputs), which starts with "import itk ; fixedImageReader = itkImageFileReaderF2_New()" I get the error "name itkImageFileReaderF2_New is not defined".
Lacking of a guide, I actually have no clue about how to use Python wrappers in general. Is there any guide that I could follow?
Useful info:
I have successfully built ITK with Cmake with the ITK-WRAP-PYTHON option. The build had some failures related to the CastXML tool... could this be a problem?
I configured a new Python virtual environment within my ITK build directory.
I copied/pasted the file /path/to/myITK_wrapped/Wrapping/Generators/Python/Debug/WrapITK.pth into wrap_itk_venv/Lib/site-packages. Is that correct to generate a symbolic link in Windows?
I also added path/to/myITK_wrapped, path/to/myITK_wrapped/bin and path/to/myITK_wrapped/bin/Debug in my user env variable PATH
Thank you for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150822/6335afa8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: error1.png
Type: image/png
Size: 31551 bytes
Desc: error1.png
URL: <http://public.kitware.com/pipermail/community/attachments/20150822/6335afa8/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BrainProtonDensitySliceBorder20.png
Type: image/png
Size: 17925 bytes
Desc: BrainProtonDensitySliceBorder20.png
URL: <http://public.kitware.com/pipermail/community/attachments/20150822/6335afa8/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BrainProtonDensitySliceShifted13x17y.png
Type: image/png
Size: 17887 bytes
Desc: BrainProtonDensitySliceShifted13x17y.png
URL: <http://public.kitware.com/pipermail/community/attachments/20150822/6335afa8/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ImageRegistration3.py
Type: application/octet-stream
Size: 4069 bytes
Desc: ImageRegistration3.py
URL: <http://public.kitware.com/pipermail/community/attachments/20150822/6335afa8/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output_image.png
Type: image/png
Size: 24164 bytes
Desc: output_image.png
URL: <http://public.kitware.com/pipermail/community/attachments/20150822/6335afa8/attachment-0007.png>
-------------- next part --------------
_____________________________________
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