17#ifndef __gt_particlegrid_h__
18#define __gt_particlegrid_h__
33 namespace Tractography {
45 template <
class HeaderType>
48 DEBUG(
"Initialise particle grid.");
49 dims[0] = Math::ceil<size_t>( image.size(0) * image.spacing(0) / (2.0*Particle::L) );
50 dims[1] = Math::ceil<size_t>( image.size(1) * image.spacing(1) / (2.0*Particle::L) );
51 dims[2] = Math::ceil<size_t>( image.size(2) * image.spacing(2) / (2.0*Particle::L) );
55 Eigen::DiagonalMatrix<default_type, 3> newspacing (2.0*Particle::L, 2.0*Particle::L, 2.0*Particle::L);
56 Eigen::Vector3d shift (image.spacing(0)/2.0 - Particle::L,
57 image.spacing(1)/2.0 - Particle::L,
58 image.spacing(2)/2.0 - Particle::L);
59 T_s2g = image.transform() * newspacing;
70 inline unsigned int getTotalCount()
const {
82 const ParticleVectorType* at(
const ssize_t x,
const ssize_t y,
const ssize_t z)
const;
111 assert (gpos[0]>=-0.5 && gpos[1]>=-0.5 && gpos[2]>=-0.5);
112 x = Math::round<size_t>(gpos[0]);
113 y = Math::round<size_t>(gpos[1]);
114 z = Math::round<size_t>(gpos[2]);
118 inline size_t xyz2idx(
const size_t x,
const size_t y,
const size_t z)
const
120 return z +
dims[2] * (y +
dims[1] * x);
size_t xyz2idx(const size_t x, const size_t y, const size_t z) const
size_t pos2idx(const Point_t &pos) const
void pos2xyz(const Point_t &pos, size_t &x, size_t &y, size_t &z) const
vector< ParticleVectorType > grid
ParticlePool manages creation and deletion of particles, minimizing the no. calls to new/delete.
class to handle writing tracks to file, with RAM buffer
Eigen::Transform< default_type, 3, Eigen::AffineCompact > transform_type
the type for the affine transform of an image: