[Insight-users] WrapITK and python : FFT computation
Gaetan Lehmann
gaetan.lehmann at jouy.inra.fr
Sat Apr 1 02:24:54 EST 2006
Zach,
Vincent,
I firstly began to reply as Zach have done, but finally thought that this case
would quite complex.
I have added those filters to WrapITK yesterday, and it have required a quite
important amount of work. It would be very easy to wrap more filters which
use std::complex<> pixels
http://voxel.jouy.inra.fr/darcsweb/darcsweb.cgi?r=WrapITK;a=commit;h=20060331234345-2fc9d-9499afeb258576a0b127de2c88412fd4e91aea95.gz
I have also translated the FFTImageFilter.cxx example (from the ITK user
guide) in python
(http://voxel.jouy.inra.fr/darcs/contrib-itk/WrapITK/Python/Tests/FFTImageFilter.py).
The tests pass on 2 systems (mandriva 2006 32 and 64 bits).
Please download the new WrapITK
(http://voxel.jouy.inra.fr/darcs/contrib-itk/WrapITK/WrapITK.tar.gz), test
it, and send feedbacks !
Gaetan
On Saturday 01 April 2006 03:54, Zachary Pincus wrote:
> Vincent -
>
> The itk::VnlFFTRealToComplexConjugateImageFilter filter is not
> wrapped by WrapITK. WrapITK aims to wrap only a common subset of the
> ITK filters, while making it easy to add new filters after the fact.
> (This latter property is a chief difference between the current ITK
> wrappers and our WrapITK project.)
>
> I would suggest creating an external project that wraps any extra
> filters you want, like the above filter. Then you can build this
> project and install it into the current WrapITK tree.
>
> To see how to make external projects, and how to write the needed
> wrap_xxx.cmake files that cause image filters to be wrapped, you can
> consult the documentation and look at the projects in WrapITK/
> ExternalProjects.
>
> A very minimal external project would look like this:
> ProjectDir/
> ProjectDir/CMakeLists.txt
> ProjectDir/wrap_VnlFFTRealToComplexConjugateImageFilter.cmake
>
> Where the CMakeLists.txt file looks like:
> PROJECT(MyProject)
> FIND_PACKAGE(WrapITK REQUIRED)
> BEGIN_WRAPPER_LIBRARY("MyProject")
> SET(WRAPPER_LIBRARY_DEPENDS ITKCommonA)
> SET(WRAPPER_LIBRARY_LINK_LIBRARIES ITKCommon)
> WRAPPER_LIBRARY_CREATE_WRAP_FILES()
> WRAPPER_LIBRARY_CREATE_LIBRARY()
>
> And where the wrap_VnlFFTRealToComplexConjugateImageFilter.cmake file
> looks like:
> WRAP_CLASS("itk::VnlFFTRealToComplexConjugateImageFilter")
> # Wrap the filter for each selected real-valued pixel type
> # and each selected dimension.
> FOREACH(d ${WRAP_ITK_DIMS})
> FOREACH(type ${WRAP_ITK_REAL})
> WRAP_TEMPLATE("${ITKM_${type}}${d}" "${ITKT_${type}},${d}")
> ENDFOREACH(type)
> ENDFOREACH(d)
> END_WRAP_CLASS()
>
> In general, the wrap_xxx.cmake files are *much* more simple for a
> generic image filter -- the above would usually have
> "WRAP_IMAGE_FILTER_REAL(1)" instead of the nested foreach loops.
> Unfortunately, for some sociopathic reason, the FFT filters are
> directly templated on PixelType and ImageDimension, instead of being
> (like every other well-behaved ITK image filter) templated on the
> image type directly.
>
>
> Zach Pincus
>
> Program in Biomedical Informatics and Department of Biochemistry
> Stanford University School of Medicine
>
> On Mar 31, 2006, at 2:44 AM, Vincent Page wrote:
> > As you can see, I discover ITK and generate a lot of emails...
> > sorry for the noise
> >
> > Right now, I succeeded the segmentation of a DICOM slice
> > and would like to compute the curvature of the contours
> > of my segmented object.
> >
> > A solution might be to use the FFT of the segmented image.
> > If someone has another idea, it would be welcomed...
> >
> > Anyway, if I want to compute a FFT, the documentation talks
> > about itk::VnlFFTRealToComplexConjugateImageFilter
> > I guess that it would be called in python + WrapITK
> >
> > itk.VnlFFTRealToComplexConjugateImageFilter
> >
> > But this doesn't exist.
> > Is it due to my installation of ITK or to WrapITK
> > (or either my installation of WrapITK...) ?
> >
> > Sincerely,
> > Vincent Pagé.
> >
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060401/af0e2df8/attachment.pgp
More information about the Insight-users
mailing list