<font><font face="verdana,sans-serif">Why are you using such an old version? Why not 4.1? It has significantly improved itk2vtk bridge.<br></font></font><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 6:33 PM, yehe_008 <span dir="ltr"><<a href="mailto:yehe_008@163.com" target="_blank">yehe_008@163.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;font-size:14px;font-family:arial"> Hello.<br><br>I installed itk3.0 and python2.7 on my ubuntu12.04. Now I have trouble to convert itk image to vtk image.<br>
For example:<br><blockquote><pre><code><span>file_name </span><span>=</span><span> </span><span>'/home/yao/workspace/test/brain.nrrd'</span><span><br>image_type </span><span>=</span><span> itk</span><span>.</span><span>Image</span><span>[</span><span>itk</span><span>.</span><span>UC</span><span>,</span><span> </span><span>3</span><span>]</span><span><br>
reader </span><span>=</span><span> itk</span><span>.</span><span>ImageFileReader</span><span>[</span><span>image_type</span><span>].</span><span>New</span><span>()</span><span><br>reader</span><span>.</span><span>SetFileName</span><span>(</span><span> file_name </span><span>)</span><span><br>
reader</span><span>.</span><span>Update</span><span>()</span><span><br><br>itk_vtk_converter </span><span>=</span><span> itk</span><span>.</span><span>ImageToVTKImageFilter</span><span>[</span><span>image_type</span><span>].</span><span>New</span><span>()</span><span><br>
itk_vtk_converter</span><span>.</span><span>SetInput</span><span>(</span><span>reader</span><span>.</span><span>GetOutput</span><span>())</span><span><br>itk_vtk_converter</span><u></u>.<span>Update</span><span>()</span><span><br>
</span></code></pre></blockquote>then I got the messge:<br><br><blockquote><pre><code><span>Traceback</span><span> </span><span>(</span><span>most recent call </span><span>last</span><span>):</span><span> </span><span>File</span><span> </span><span>"ex1.py"</span><span>,</span><span> line </span><span>11</span><span>,</span><span> </span><span>in</span><span> </span><span><module></span><span><br>
itk_vtk_converter </span><span>=</span><span> itk</span><span>.</span><span>ImageToVTKImageFilter</span><span>[</span><span>image_t
ype</span><span>].</span><span>New</span><span>()</span><span> </span><span>File</span><span> </span><span>"/usr/lib/InsightToolkit/WrapITK/Python/itkLazy.py"</span><span>,</span><span> line </span><span>14</span><span>,</span><span> </span><span>in</span><span><br>
__getattribute__<br> value </span><span>=</span><span> types</span><span>.</span><span>ModuleType</span><span>.</span><span>__getattribute__</span><span>(</span><span>self</span><span>,</span><span> attr</span><span>)</span><span> </span><span>AttributeError</span><span>:</span><span> </span><span>'LazyITKModule'</span><span> <span>object</span><span> has </span><span>no</span><span> attribute </span><span>'ImageToVTKImageFilter'</span><span><br>
</span></span></code></pre></blockquote>How can i make it work?<br><br>Cheers<br><br>- Lisa<br></div><br><br><span title="neteasefooter"><span></span></span><br>_____________________________________<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>