[Insight-users] Python Wrap_ITK and registration of Nifti files

Malsoaz James jmalsoaz at yahoo.fr
Mon Aug 10 20:21:23 EDT 2009


Thank you very much for the help. Indeed, it is working with the name of modules that you gave.

Is there a list somewhere of all these names? I still have some problems to find the corresponding for some of them (e.g. itkLinearInterpolateImageFunctionF2D, itkCenteredRigid2DTransform, etc)


Anyway thank you again !

--- En date de : Sam 8.8.09, Luis Ibanez <luis.ibanez at kitware.com> a écrit :

De: Luis Ibanez <luis.ibanez at kitware.com>
Objet: Re: [Insight-users] Python Wrap_ITK and registration of Nifti files
À: "Malsoaz James" <jmalsoaz at yahoo.fr>
Cc: insight-users at itk.org
Date: Samedi 8 Août 2009, 14h52


Hi James,

Yes, the problem is that the examples in ITK are for the
original CableSwig wrapping.

You are using WrapITK, and it is not fully backward compatible
with the original wrapping system.



You will find more information about WrapITK in the
following Insight Journal paper:

http://www.insight-journal.org/browse/publication/85

 http://hdl.handle.net/1926/188



The reader types that you may want to use are:

itk.ImageFileReader[itk.Image.F2] oritk.ImageFileReader.IF2



More specifically, your code should look like:


imageType = itk.Image.F2
imageReaderType = itk.ImageReader[imageType]
registrationType = itk.ImageRegistrationMethod[imageType,imageType]


reader1 = readerType.New()
reader2 = readerType.New()

registrator = registrationType.New()

registrator.SetFixedImage( reader1.GetOutput() )
registrator.SetMovingImage( reader2.GetOutput() )



....

and so on.


Please give it a try and let us know if you find any problems,


     Thanks


          Luis


------------------------------------------------------

On Fri, Aug 7, 2009 at 2:29 PM, Malsoaz James <jmalsoaz at yahoo.fr> wrote:


Hello,

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].
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.


I have been able to install ITK with the option wrap_ITK and the 'import itk' in Python is working.

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). 
Do I have made something wrong with the wrapping? Maybe the fact that I use Wrap_ITK and not CSWIG is the problem.


If someone has worked on similar thing, I would be happy to receive help (ie examples, etc).


By the way, is there any help/documentation about WrapITK except the google page code?

Thank you
Best
James






      
_____________________________________

Powered by www.kitware.com



Visit other Kitware open-source projects at

http://www.kitware.com/opensource/opensource.html



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://www.itk.org/mailman/listinfo/insight-users







      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090811/72d670c4/attachment.htm>


More information about the Insight-users mailing list