18#ifndef __adapter_regrid_h__
19#define __adapter_regrid_h__
28 template <
class ImageType>
30 public Base<Regrid<ImageType>,ImageType>
38 using base_type::spacing;
40 template <
class VectorType>
41 Regrid (
const ImageType& original,
const VectorType& from,
const VectorType& size,
const value_type fill = 0) :
48 v.push_back (
from_[d] < 0 ||
size_[d] > original.size(d) -
from_[d]); }
return v; }()),
53 assert(
from_.size() == ndim());
55 for (
size_t n = 0; n < ndim(); ++n)
57 throw Exception(
"FIXME: negative size in Regrid adapter");
60 for (
size_t j = 0; j < 3; ++j)
61 for (
size_t i = 0; i < 3; ++i)
67 for (
size_t n = 0; n < ndim(); ++n)
71 size_t ndim ()
const {
return size_.size(); }
75 ssize_t get_index (
size_t axis)
const {
79 void move_index (
size_t axis, ssize_t increment) {
89 parent().index(
axis) += increment;
97 return parent().value();
101 using base_type::parent;
transform_type transform_
const vector< ssize_t > from_
const vector< vector< ssize_t > > index_invalid_lower_upper
const vector< bool > index_requires_bound_check
const vector< ssize_t > size_
MR::default_type value_type
Eigen::Transform< default_type, 3, Eigen::AffineCompact > transform_type
the type for the affine transform of an image: