17#ifndef __registration_multi_resolution_lmax_h__
18#define __registration_multi_resolution_lmax_h__
22#include "filter/smooth.h"
27 namespace Registration
30 template <
class ImageType>
33 const bool do_reorientation =
false,
34 const uint32_t lmax = 0)
38 for (
size_t dim = 0; dim < input.ndim(); ++dim)
39 size[dim] = input.size(dim);
45 for (
size_t dim = 0; dim < 3; ++dim)
46 stdev[dim] = input.spacing(dim) / (2.0 * scale_factor);
48 smooth_filter.set_stdev (
stdev);
49 DEBUG (
"creating scratch image for smoothing input image...");
50 auto smoothed = ImageType::scratch (smooth_filter);
52 DEBUG (
"smoothing input image based on scale factor...");
53 smooth_filter (smoothed);
59 template <
class ImageType>
62 const bool do_reorientation,
68 for (
size_t ic = 0; ic < contrast.size(); ic++) {
69 const auto & mc = contrast[ic];
70 assert (mc.nvols > 0);
71 for (
size_t i = 0; i < mc.nvols; i++)
72 volume_indices.push_back(mc.start + i);
75 (*contrast_updated)[ic].start = start;
82 for (
size_t dim = 0; dim < 3; ++dim)
83 stdev[dim] = input.spacing(dim) / (2.0 * scale_factor);
85 smooth_filter.set_stdev (
stdev);
86 DEBUG (
"creating scratch image for smoothing input image...");
87 auto smoothed = ImageType::scratch (smooth_filter);
89 DEBUG (
"smoothing input image based on scale factor...");
90 smooth_filter (smoothed);
matrix_type stdev(const matrix_type &measurements, const matrix_type &design)
size_t NforL(int lmax)
the number of (even-degree) coefficients for the given value of lmax
FORCE_INLINE ImageType multi_resolution_lmax(ImageType &input, const default_type scale_factor, const bool do_reorientation=false, const uint32_t lmax=0)
double default_type
the default type used throughout MRtrix
void threaded_copy(InputImageType &source, OutputImageType &destination, const vector< size_t > &axes, size_t num_axes_in_thread=1)