MCPcopy Create free account
hub / github.com/MITK/MITK / wrap1d

Function wrap1d

Modules/Pharmacokinetics/include/mitkConvolutionHelper.h:36–47  ·  view source on GitHub ↗

\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. */

Source from the content-addressed store, hash-verified

34 * \param[in] kernel The input kernel array.
35 * \return The wrapped kernel array. */
36inline 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 *

Callers

nothing calls this directly

Calls 2

GetNumberOfElementsMethod · 0.80
GetElementMethod · 0.45

Tested by

no test coverage detected