[ITK-users] simpleitk image casting?

Bradley Lowekamp blowekamp at mail.nih.gov
Mon May 19 21:19:31 EDT 2014


Hello,

Glad to hear it working for you.

To extract a component from an SimpleITK Image with Vector Pixel you you can use the lengthly name VectorIndexSelection cast filter[1].

And then to compose can use the RealAndImaginaryToComplex[2] filter2.

There are many ways that this could be done. How did you expect it to be in SimpleITK?

Brad


[1] http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1VectorIndexSelectionCastImageFilter.html
[2] http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1RealAndImaginaryToComplexImageFilter.html
On May 19, 2014, at 1:25 PM, Robert.Atwood at diamond.ac.uk wrote:

> Hi,
> I have just discovered the iPython + simpleITK combination and may very well reduce a lot of barriers to the general use of ITK here by virtue of being 'simple' and working very well with NumPy 
> 
> 
> However, I was just trying to implement a relatively simple algorithm previously programmed not using ITK at all .. in this I require the results of the gradient filter interpreted such that the horizontal gradient is the real part of a complex number and the vertical gradient is the imaginary part. I cannot figure out a 'simple' way to do this, can this be done within sitk or must I extrac the array , manipulate it in Numpy , and load it back as an  (complex) image?  Then the script is much less 'simple'!
> 
> Thanks in advance 
> A SimpleITK convert ! 
> 
> Robert
> 
> 
> 
> 
> -- 
> This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
> Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
> Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
> Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
> 
> 
> 
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> 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



More information about the Insight-users mailing list