Developer documentation
Version 3.0.3-105-gd3941f44
MR::Adapter::Reslice< Interpolator, ImageType > Class Template Reference

an Image providing interpolated values from another Image More...

#include "adapter/reslice.h"

Inheritance diagram for MR::Adapter::Reslice< Interpolator, ImageType >:

Detailed Description

template<template< class ImageType > class Interpolator, class ImageType>
class MR::Adapter::Reslice< Interpolator, ImageType >

an Image providing interpolated values from another Image

the Reslice class provides an Image interface to data interpolated using the specified Interpolator class from the Image original. The Reslice object will have the same dimensions, voxel sizes and transform as the reference HeaderType. Any of the interpolator classes (currently Interp::Nearest, Interp::Linear, Interp::Cubic and Interp::Sinc) can be used.

For example:

// reference header:
auto reference = Header::open (argument[0]);
// input data to be resliced:
auto input = Image<float>::open (argument[1]);
Adapter::Reslice<Interp::Cubic, Image<float> > reslicer (input, reference);
auto output = Image::create<float> (argument[2], reslicer);
// copy data from regridder to output
copy (reslicer, output);
static Image open(const std::string &image_name, bool read_write_if_existing=false)
Definition: image.h:189
vector< ParsedArgument > argument
the list of arguments parsed from the command-line
void copy(InputImageType &&source, OutputImageType &&destination, size_t from_axis=0, size_t to_axis=std::numeric_limits< size_t >::max())
Definition: copy.h:27

It is also possible to supply an additional transform to be applied to the data, using the transform parameter. The transform will be applied in the scanner coordinate system, and should map scanner-space coordinates in the original image to scanner-space coordinates in the reference image.

To deal with possible aliasing due to sparse sampling of a high-resolution image, the Reslice object may perform over-sampling, whereby multiple samples are taken at regular sub-voxel intervals and averaged. By default, oversampling will be performed along those axes where it is deemed necessary. This can be over-ridden using the oversampling parameter, which should contain one (integer) over-sampling factor for each of the 3 imaging axes. Specifying the vector [ 1 1 1 ] will therefore disable over-sampling.

See also
Interp::reslice()

Definition at line 110 of file reslice.h.


The documentation for this class was generated from the following file: