[Insight-users] periodic boundary conditions and recursive gaussian filter

Luis Ibanez luis.ibanez at kitware.com
Tue Jul 12 11:12:48 EDT 2005


Hi Jan,


One alternative is to do the operation in the Fourier domain.
If you compute the FFT of your image, and multiply it with
the FFT of the Gaussian derivative, then do the IFFT of the
result, you end up with the convolution of the Gaussian and
your Periodic image.

This is because the FFT operation implies that both the image
and the spectrum are periodic.

You will find examples on the use of the FFT classes in the
directory


            Insight/Examples/Filtering


Note that the FFT of the derivative of a function can be
expressed in terms of the FFT of the function in a complex
operation. You may want to check on any Fourier analysis
text book.

      if        F(w) is the FFT of function f(x)
      then   iw F(w) is the FFT of f'(x)

http://www.algebra.com/algebra/about/history/Continuous-Fourier-transform.wikipedia



   Regards,


      Luis




---------------------
Jan Ehrhardt wrote:

> Hi Luis,
> 
> thanks for your answer. Enlarging the filter array in the recursive 
> filter appears to me the fastest way to solve my problem and I think is 
> a good approximation to the correct periodic filtering.
> 
> Is there another (more simple) way for a periodic convolution with a 
> gaussian derivative? I can use the itkGaussianOperator for smoothing, 
> but actual I see no way to convolve an image with a gaussian derivative 
> using periodic boundary conditions, without writing my own filter class.
> 
> I found the classes itkGaussianDerivativeImageFunction 
> <cid:part1.07090305.03050509 at uke.uni-hamburg.de> and 
> itkGaussianDerivativeSpatialFunction 
> <cid:part2.03010205.09020608 at uke.uni-hamburg.de> but I don't know how to 
> use these classes for filtering. Can you give me a short hint?
> 
> Thanks and regards,
> 
> Jan
> 
> Luis Ibanez wrote:
> 
>>
>> Hi Jan,
>>
>>
>>
>>    Yes, It is possible   :-)
>>
>>
>>    But, It is not implemented.
>>
>>
>>
>> This is a non-trivial task. In order to implement periodic
>> boundary conditions you will have to get familiar with the
>> computation of the coefficients for the IIR filters that are
>> used in the Recursive Gaussian Filter.
>>
>> Note that it is not as simple as enlarging the array and
>> tricking the filter by suffing the replicated values, because
>> this filter is not using a finite support for a convolution
>> kernel. This filter actually approximates an infinite support
>> kernel.
>>
>>
>> This can well be a semester project for a student
>> in a signal processing class.
>>
>>
>> ---
>>
>> About the Doxygen question, what happens is the our use of
>> Generic Programming makes harder for Doxygen to figure out
>> all the inheritance relationships.
>>
>>
>> One way of getting a full list of derived classes is by using
>> SourceNavigator
>>
>>          http://sourcenav.sourceforge.net/
>>
>> This nice application builds a full database of a software
>> project and helps you browse the code by finding all the
>> variables, types, functions, classes and header relationships.
>>
>>
>>
>>
>>     Regards,
>>
>>
>>
>>       Luis
>>
>>
>>
>>
>> -------------------
>> Jan Ehrhardt wrote:
>>
>>> Hi,
>>>
>>> is it possible to get periodic boundary conditions for the 
>>> RecursiveGaussianImageFilter (or more general for
>>> RecursiveSeparableImageFilters) ?
>>> Specifically, I want to calculate the gradient (with a gaussian 
>>> derivative) of an image with periodic boundary conditions in 
>>> z-direction and neumann conditions in x/y-direction. In the next 
>>> step, I want to apply gaussian smoothing to a N-dimensional 
>>> vector-field with periodic boundary conditions in z-direction and 
>>> neumann conditions in x/y-direction.
>>>
>>> One idea is to reimplement RecursiveSeparableImageFilters and to 
>>> enlarge the array given to FilterDataArray (..). But how many values 
>>> I have to add?
>>>
>>> Another small problem: the doxygen documentation don't lists all  
>>> subclasses in the inheritance diagramm. How can I get a list of _all_ 
>>> subclasses e.g. of the ImageToImageFilter ?
>>>
>>> Thanks,
>>>
>>> Jan
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
> 
> 





More information about the Insight-users mailing list