17#ifndef __dwi_tractography_tracking_method_h__
18#define __dwi_tractography_tracking_method_h__
32 namespace Tractography
59 template <
class InterpolatorType>
60 FORCE_INLINE bool get_data (InterpolatorType& source,
const Eigen::Vector3f& position)
62 if (!source.scanner (position))
64 for (
auto l =
Loop (3) (source); l; ++l)
65 values[source.index(3)] = source.value();
66 return !std::isnan (
values[0]);
69 template <
class InterpolatorType>
72 return get_data (source, pos);
75 virtual bool init() = 0;
77 virtual float get_metric (
const Eigen::Vector3f& position,
const Eigen::Vector3f& direction) = 0;
79 virtual void reverse_track() {
if (act_method_additions) act().reverse_track(); }
80 virtual void truncate_track (
GeneratedTrack& tck,
const size_t length_to_revert_from,
const size_t revert_step);
86 Eigen::Vector3f pos, dir;
91 std::unique_ptr<ACT::ACT_Method_additions> act_method_additions;
95 std::uniform_real_distribution<float>
uniform;
100 Eigen::Vector3f
rotate_direction (
const Eigen::Vector3f& reference,
const Eigen::Vector3f& direction);
std::uniform_real_distribution< float > uniform
Eigen::Vector3f random_direction(const float max_angle, const float sin_max_angle)
Eigen::Vector3f rotate_direction(const Eigen::Vector3f &reference, const Eigen::Vector3f &direction)
Eigen::Vector3f random_direction()
FORCE_INLINE Eigen::Vector3f random_direction(const Eigen::Vector3f &d, const float max_angle, const float sin_max_angle)
ssize_t size(size_t axis) const
FORCE_INLINE LoopAlongAxes Loop()