[Insight-users] 3 questions (FFT filters)

Jakub Bican jakub.bican at matfyz.cz
Sat Sep 16 08:51:42 EDT 2006


Hello,

i am writing a new filter and i am facing following problems. The first 
two problems are rather philosophic, while the last one is a compilation 
error.

Thanks very much for the answers and advices,
      
       Jakub


1) choosing class for FFT
My filter is a mini-pipeline filter, that needs to perform FFT and IFFT 
at several points of computation. As far as i know, there are two 
possibilities for making FFT and IFFT - use fftw or vnl.

I want to write the filter as general as possible, so i don't want it to 
be dependent on any of these exchangeable(?) possibilities. I consider 
these options:
    a) use constantly only fftw OR vnl (but which one of these should be 
preffered in this case? and what of fftw is not available?)
    b) choose the one, which is available during compilation ( I am not 
sure how is this manageable now - if something like #ifdef USE_FFTW... 
can be used, and which possiblity should be preffered if both are 
available. )
    c) let the user specify the possibility (e.g. filter->UseFFTWOn() ?)
    b) let the user pass in the filter (e.g. 
filter->SetRealToComplexConjugateFilter(...)) - this is very unhandy, as 
the filter uses several instances of FFT and IFFT filters

2) Instantiating FFT filter templates
My filter is templated over input image type, but internally, i need to 
compute FFT in floating point - float should be enough for my 
computations. So there will be cast filter at the begginning of the 
mini-pipeline, that will cast arbitrary input data type to my internal 
floating point type - float.

But what if user passes in a double data? Than there is a risk while 
casting data to float...

But if i use internally double, then i will be wasting resources for all 
"smaller" data types.

Again, if there will be a template parameter that will determine this, 
then the user will have to set something, that is internal for the filter.

3) impossible to pass origin into image
I need to manually set an origin of an image:
  double origin[ Dimension ];
  for (unsigned int i = 0; i < Dimension; i++)
    {
    origin[i] = 0.0;
    }
  movingImage->SetOrigin(origin);

during compilation, i get following error:
test.cxx(109): error C2663: 'itk::ImageBase<VImageDimension>::SetOrigin' 
: 3 overloads have no legal conversion for 'this' pointer
        with
        [
            VImageDimension=2
        ]

I am compiling on WinXP+MSVS.NET (2003)




More information about the Insight-users mailing list