Developer documentation
Version 3.0.3-105-gd3941f44
reslice.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __filter_reslice_h__
18#define __filter_reslice_h__
19
20#include "adapter/reslice.h"
21#include "algo/threaded_copy.h"
22#include "datatype.h"
23
24namespace MR
25{
26 namespace Filter
27 {
28
30
47 template <template <class ImageType> class Interpolator, class ImageTypeDestination, class ImageTypeSource>
48 void reslice (
49 ImageTypeSource& source,
50 ImageTypeDestination& destination,
51 const transform_type& transform = Adapter::NoTransform,
52 const vector<uint32_t>& oversampling = Adapter::AutoOverSample,
54 {
55 Adapter::Reslice<Interpolator, ImageTypeSource> interp (source, destination, transform, oversampling, value_when_out_of_bounds);
56 threaded_copy_with_progress_message ("reslicing \"" + source.name() + "\"", interp, destination, 0, source.ndim(), 2);
57 }
58
59
61 }
62}
63
64#endif
65
66
67
68
an Image providing interpolated values from another Image
Definition: reslice.h:112
This class defines the interface for classes that perform image interpolation.
Definition: base.h:70
const vector< uint32_t > AutoOverSample
const transform_type NoTransform
void reslice(ImageTypeSource &source, ImageTypeDestination &destination, const transform_type &transform=Adapter::NoTransform, const vector< uint32_t > &oversampling=Adapter::AutoOverSample, const typename ImageTypeDestination::value_type value_when_out_of_bounds=Interp::Base< ImageTypeDestination >::default_out_of_bounds_value())
convenience function to regrid one Image onto another
Definition: reslice.h:48
MR::default_type value_type
Definition: typedefs.h:33
Definition: base.h:24
Eigen::Transform< default_type, 3, Eigen::AffineCompact > transform_type
the type for the affine transform of an image:
Definition: types.h:234
void threaded_copy_with_progress_message(const std::string &message, InputImageType &source, OutputImageType &destination, const vector< size_t > &axes, size_t num_axes_in_thread=1)
Definition: threaded_copy.h:69