|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Helper functions for 1D convolution via VNL Fourier transformation. More...
Functions | |
| itk::Array< double > | wrap1d (itk::Array< double > kernel) |
| Wraps (circularly shifts) a 1D convolution kernel. More... | |
| itk::Array< double > | zeropadding1d (itk::Array< double > unpaddedSpectrum, int paddedDimension) |
| Zero-pads a 1D array to a specified size. More... | |
| itk::Array< double > | unpadAndScale (itk::Array< double > convolutionResult, int initialDimension) |
| Removes padding and scales the result after inverse FFT. More... | |
| void | prepareConvolution (const itk::Array< double > &kernel, const itk::Array< double > &spectrum, itk::Array< double > &preparedKernel, itk::Array< double > &preparedSpectrum) |
| Prepares two arrays for FFT-based convolution. More... | |
Helper functions for 1D convolution via VNL Fourier transformation.
This namespace provides utility functions for preparing arrays for convolution using vnl_fft_1d, including kernel wrapping (circular shift) and zero-padding to avoid boundary artefacts.
|
inline |
Prepares two arrays for FFT-based convolution.
Zero-pads both the kernel and spectrum arrays to the sum of their sizes so they are ready for forward FFT transformation.
| [in] | kernel | The convolution kernel array. |
| [in] | spectrum | The signal array to be convolved. |
| [out] | preparedKernel | The zero-padded kernel. |
| [out] | preparedSpectrum | The zero-padded spectrum. |
Definition at line 107 of file mitkConvolutionHelper.h.
References zeropadding1d().
|
inline |
Removes padding and scales the result after inverse FFT.
After the backward FFT transformation, this function extracts the valid portion of the result (removing padding) and divides by the transform size to correct the FFT scaling.
| [in] | convolutionResult | The raw inverse-FFT output. |
| [in] | initialDimension | The original (unpadded) array size. |
Definition at line 84 of file mitkConvolutionHelper.h.
|
inline |
Wraps (circularly shifts) a 1D convolution kernel.
Performs a circular shift of the kernel by half its length, which is required for proper FFT-based convolution.
| [in] | kernel | The input kernel array. |
Definition at line 36 of file mitkConvolutionHelper.h.
|
inline |
Zero-pads a 1D array to a specified size.
Adds zeros symmetrically around the input array so it reaches the desired padded dimension. This prevents circular convolution artefacts in FFT-based convolution.
| [in] | unpaddedSpectrum | The input array to be padded. |
| [in] | paddedDimension | The target size after padding (sum of both convolution operand sizes). |
Definition at line 56 of file mitkConvolutionHelper.h.
Referenced by prepareConvolution().