\brief 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. * \param[in] kernel The input kernel array. * \return The wrapped kernel array. */
| 34 | * \param[in] kernel The input kernel array. |
| 35 | * \return The wrapped kernel array. */ |
| 36 | inline itk::Array<double> wrap1d(itk::Array<double> kernel) |
| 37 | { |
| 38 | int dim = kernel.GetNumberOfElements(); |
| 39 | itk::Array<double> wrappedKernel(dim); |
| 40 | wrappedKernel.fill(0.); |
| 41 | for(int i=0; i< dim; ++i) |
| 42 | { |
| 43 | wrappedKernel.SetElement(i, kernel.GetElement((i+(dim/2))%dim)); |
| 44 | } |
| 45 | |
| 46 | return wrappedKernel; |
| 47 | } |
| 48 | |
| 49 | /** \brief Zero-pads a 1D array to a specified size. |
| 50 | * |
nothing calls this directly
no test coverage detected