<br>Hi James,<br><br>Yes, the problem is that the examples in ITK are for the<br>original CableSwig wrapping.<br><br>You are using WrapITK, and it is not fully backward compatible<br>with the original wrapping system.<br><br>
<br>You will find more information about WrapITK in the<br>following Insight Journal paper:<br><br><a href="http://www.insight-journal.org/browse/publication/85">http://www.insight-journal.org/browse/publication/85</a><br>
<a href="http://hdl.handle.net/1926/188">http://hdl.handle.net/1926/188</a><br><br><br><br>The reader types that you may want to use are:<br><br><ul><li>itk.ImageFileReader[itk.Image.F2] or</li><li>itk.ImageFileReader.IF2<br>
</li></ul><br><br>More specifically, your code should look like:<br><br><br>imageType = itk.Image.F2<br>imageReaderType = itk.ImageReader[imageType]<br>registrationType = itk.ImageRegistrationMethod[imageType,imageType]<br>
<br>reader1 = readerType.New()<br>reader2 = readerType.New()<br><br>registrator = registrationType.New()<br><br>registrator.SetFixedImage( reader1.GetOutput() )<br>registrator.SetMovingImage( reader2.GetOutput() )<br><br>
<br>....<br><br>and so on.<br><br><br>Please give it a try and let us know if you find any problems,<br><br><br> Thanks<br><br><br> Luis<br><br><br>------------------------------------------------------<br><div class="gmail_quote">
On Fri, Aug 7, 2009 at 2:29 PM, Malsoaz James <span dir="ltr"><<a href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
<div>Hello,<br><br>I'm quite new in the use of ITK and I would like to create a function to align two images in Python. My files are Nifti files with this specific dim: [5, 256, 256, 124, 1, 1, 1, 1].<br>I have a list of Nifti files and I would like to take the first one as reference to align the other on it using a rigid transformation.<br>
<br>I have been able to install ITK with the option wrap_ITK and the 'import itk' in Python is working.<br><br>Now, I would like to work on my registration problem. I have seen an example called "ImageRegistration5.py" in the folder examples which normally is used to align 2D images with a rigid transformation (very close from what I desire, except for the dimension, I'm working with 5). But the function used in there are not available in my python environment (ie itkImageFileReaderF2_New(),
itkImageRegistrationMethodF2F2_New(), etc). <br>Do I have made something wrong with the wrapping? Maybe the fact that I use Wrap_ITK and not CSWIG is the problem.<br><br><br>If someone has worked on similar thing, I would be happy to receive help (ie examples, etc).<br>
<br>By the way, is there any help/documentation about WrapITK except the google page code?<br><br>Thank you<br>Best<br>James<br><br></div></td></tr></tbody></table><br>
<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>
Please keep messages on-topic and check the ITK FAQ at: <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>