[ITK] [ITK-users] SimpleITK FFTConvolution
Bradley Lowekamp
blowekamp at mail.nih.gov
Thu Apr 2 09:54:30 EDT 2015
Gaetan,
Nice to see you taking SimpleITK for a spin :)
You need to inspect the input image types a little. It's reading them an RGB images into a VectorImage type. Implicit types can be a pain.
You can utilize the second argument of the ReadImage method to specify the desired pixel type, say "sitk.sitkFloat32".
Brad
BTW,
I have been wanting to pick you brain about way to make the LabelMaps more extendible. I did some classes [1] where the parents was a template argument, so that you could compose different label map objects, and similarly filters. The usage got a little complicated though[2].
[1] https://github.com/blowekamp/itkOBBLabelMap/tree/master/include
[2] https://github.com/blowekamp/itkOBBLabelMap/blob/master/test/itkOrientedBoundingBoxImageLabelMapFilterTest1.cxx#L42
On Apr 2, 2015, at 9:47 AM, Gaetan Lehmann <gaetan.lehmann at gmail.com> wrote:
> Hi Brad,
>
> I'm trying to use SimpleITK's FFTConvolution from python:
>
> import SimpleITK as sitk
> img = sitk.ReadImage("/tmp/cthead1.png")
> kernel = sitk.ReadImage("/tmp/kernel2.png")
> conv = sitk.FFTConvolution(img, kernel)
>
> the last line fails with the error:
>
> Traceback (most recent call last):
> File "/tmp/test.py", line 5, in <module>
> conv = sitk.FFTConvolution(img, kernel)
> File "/Users/glehmann/Library/Python/2.7/lib/python/site-packages/SimpleITK/SimpleITK.py", line 17771, in FFTConvolution
> return _SimpleITK.FFTConvolution(*args, **kwargs)
> RuntimeError: Exception thrown in SimpleITK FFTConvolution: /scratch/dashboards/SimpleITK-OSX10.7-intel-pkg/SimpleITK/Code/Common/include/sitkMemberFunctionFactory.hxx:193:
> sitk::ERROR: Pixel type: vector of 8-bit unsigned integer is not supported in 2D byN3itk6simple25FFTConvolutionImageFilterE
>
> I get the same error when building from source and when installing SimpleITK with
>
> pip install --user SimpleITK
>
> This is on a mac running yosemite.
>
> Would you have an idea of what is wrong?
>
> Thanks,
>
> Gaëtan
>
_____________________________________
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://public.kitware.com/mailman/listinfo/insight-users
More information about the Community
mailing list