17#ifndef __adapter_subset_h__
18#define __adapter_subset_h__
27 template <
class ImageType>
29 public Base<Subset<ImageType>,ImageType>
37 using base_type::spacing;
39 template <
class VectorType>
40 Subset (
const ImageType& original,
const VectorType& from,
const VectorType& size) :
46 for (
size_t n = 0; n < ndim(); ++n) {
48 throw Exception (
"FIXME: sizes requested for Subset adapter must be positive");
50 throw Exception (
"FIXME: dimensions requested for Subset adapter are out of bounds!");
53 for (
size_t j = 0; j < 3; ++j)
54 for (
size_t i = 0; i < 3; ++i)
59 for (
size_t n = 0; n < ndim(); ++n)
63 size_t ndim ()
const {
return size_.size(); }
67 ssize_t get_index (
size_t axis)
const {
return parent().index(
axis)-
from_[
axis]; }
68 void move_index (
size_t axis, ssize_t increment) { parent().index(
axis) += increment; }
71 using base_type::parent;
const vector< ssize_t > from_
const vector< ssize_t > size_
transform_type transform_
MR::default_type value_type
Eigen::Transform< default_type, 3, Eigen::AffineCompact > transform_type
the type for the affine transform of an image: