I grabbed 4.2 from the website yesterday. I have just found that `import itk` works, but I am trying to follow the python registration examples -- i.e. <a href="https://github.com/Kitware/ITK/blob/master/Examples/Registration/ImageRegistration3.py">https://github.com/Kitware/ITK/blob/master/Examples/Registration/ImageRegistration3.py</a> where `import InsightToolkit` is used.<div>
<br></div><div>If I comment out the line from the error message, I am able to import it and the example linked above runs; this is probably the solution for now if there is nothing wrapped anyway.</div><div>> File "/usr/local/lib/ITK-4.2/Python/InsightToolkit.py", line 77, in <module><br>
<div><div><br></div><div>Brett.<br><br><div class="gmail_quote">On Tue, Oct 2, 2012 at 5:07 PM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Brett,<br>
<br>
What version of ITK did you compile? I have a version of 4.2 with wrapITK that is working just fine. I usually do an "import itk".<br>
<br>
There is nothing wrapped in the Metricsv4 directory:<br>
<br>
<a href="https://github.com/Kitware/ITK/tree/master/Modules/Registration/Metricsv4/wrapping" target="_blank">https://github.com/Kitware/ITK/tree/master/Modules/Registration/Metricsv4/wrapping</a><br>
<br>
So I don't think you are missing anything.<br>
<br>
Brad<br>
<div><div class="h5"><br>
On Oct 2, 2012, at 11:49 AM, Brett Tully <<a href="mailto:brett.tully@oxyntix.com">brett.tully@oxyntix.com</a>> wrote:<br>
<br>
> Dear all,<br>
><br>
> I have built ITK from source, and I believe that it has succeeded (some the C++ examples run with no problems). However, I am trying to use ITK through Python and I get the following error:<br>
><br>
> >>> import InsightToolkit as itk<br>
> Traceback (most recent call last):<br>
> File "<stdin>", line 1, in <module><br>
> File "/usr/local/lib/ITK-4.2/Python/InsightToolkit.py", line 77, in <module><br>
> from ITKMetricsv4Python import *<br>
> ImportError: No module named ITKMetricsv4Python<br>
><br>
> I have tried searching the web, and have compiled with various different options, but I can't seem to get it to work. I am sure that the related C++ has compiled, as ./ITKMetricsv4TestDriver runs just fine...<br>
><br>
> Am I missing something obvious?<br>
><br>
> Thanks,<br>
> Brett.<br>
><br>
><br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>
</blockquote></div><br></div></div></div>