<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi<div><br></div><div>for the moment, the PyBuffer module has been moved out of ITK, and is no more maintained.</div><div>There was a port done for ITK4, but it is not tested so I don’t know how well it is working [1]</div><div>I plan to work a little bit on it one day if I can find some time.</div><div><br></div><div>The way to move images from itk to vtk is to use the ITKVTKGlue module.</div><div>You need to build ITK with:</div><div>Module_ITKVtkGlue=ON</div><div><br></div><div>Then you can do something like this (for a 2d image for example):</div><div><br></div><div><div>image_type = itk.Image[itk.UC, 2]</div><div>reader = itk.ImageFileReader[image_type].New()</div><div>reader.SetFileName(“PATH/TO/FILE”)</div><div>reader.Update()</div><div>vtk_image = itk.ImageToVTKImageFilter[image_type].New()</div><div>vtk_image.SetInput(reader.GetOutput())</div><div>vtk_image.Update()</div></div><div><br></div><div>Then you can use the vtk_image as a vtk object, that you can render or work on.</div><div><br></div><div>Is there a specific error message you get ?</div><div><br></div><div>Michka</div><div><br></div><div>[1] <a href="https://github.com/InsightSoftwareConsortium/itkPyBuffer">https://github.com/InsightSoftwareConsortium/itkPyBuffer</a></div><div><br><div><div>On 2 oct. 2014, at 11:45, Paola Volonghi <<a href="mailto:pola_88@hotmail.it">pola_88@hotmail.it</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 12pt; font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr"><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">Hi all,</span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">we developed a python program on ubuntu 13.10 using vtk library ver. 5.8.0 and itk library ver. 3.20.1. In our program we used also these command lines:</span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">itk.VTKImageToImageFilter.IF3.New()<o:p></o:p></span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">itk.ImageToVTKImageFilter[image_type].New()<o:p></o:p></span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">itk.PyBuffer[image_type].GetArrayFromImage( …. )<b><o:p></o:p></b></span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">but we discovered that they don't work on itk ver. 4.x.</span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">Is there another way to convert images from itk to vtk and vice versa, using the newest versions of vtk and itk?</span></div><p class="Standard" style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US"> </span></p><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">Thanks!</span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US"><br></span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US">Paola</span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US"><br></span></div><div style="margin: 0px; padding: 0px; line-height: 24px;"><span lang="EN-US"><br></span></div></div>_______________________________________________<br>Community mailing list<br><a href="mailto:Community@itk.org">Community@itk.org</a><br><a href="http://public.kitware.com/mailman/listinfo/community">http://public.kitware.com/mailman/listinfo/community</a></div></blockquote></div><br></div></body></html>