[Insight-users] WrapITK and python : FFT computation

Zachary Pincus zpincus at stanford.edu
Fri Mar 31 20:54:17 EST 2006


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



More information about the Insight-users mailing list