17#ifndef __adapter_neighbourhood_h__
18#define __adapter_neighbourhood_h__
27 template <
class ImageType>
29 public Base<NeighbourhoodCoord<ImageType>,ImageType>
37 using base_type::spacing;
40 template <
class VectorType>
46 assert (extent.size() == ndim());
47 from_.resize(original.ndim());
48 size_.resize(original.ndim());
49 for (
size_t i = 0; i < ndim(); ++i){
51 size_[i] = (
from_[i] + extent[i] >= original.size(i)) ? original.size(i) -
from_[i] -1 : extent[i];
52 assert (
from_[n] +
size_[n] < original.size(n));
59 for (
size_t j = 0; j < 3; ++j)
60 for (
size_t i = 0; i < 3; ++i)
65 for (
size_t n = 0; n < ndim(); ++n)
69 size_t ndim ()
const {
return size_.size(); }
73 ssize_t get_index (
size_t axis)
const {
return parent().index(
axis)-
from_[
axis]; }
74 void move_index (
size_t axis, ssize_t increment) { parent().index(
axis) += increment; }
77 using base_type::parent;
transform_type transform_
a dummy image to iterate over, useful for multi-threaded looping.
const ssize_t & index(size_t axis) const
MR::default_type value_type
Eigen::Transform< default_type, 3, Eigen::AffineCompact > transform_type
the type for the affine transform of an image: