17#ifndef __dwi_tractography_act_method_h__
18#define __dwi_tractography_act_method_h__
30#define GMWMI_NORMAL_PERTURBATION 0.001
37 namespace Tractography
51 sgm_seed_to_wm (
false),
52 act_image (shared.act().voxel) { }
57 sgm_seed_to_wm (
false),
58 act_image (that.act_image) { }
63 const Tissues& tissues()
const {
return tissue_values; }
66 term_t check_structural (
const Eigen::Vector3f& pos)
68 if (!fetch_tissue_data (pos))
71 if (tissues().is_csf())
74 if (tissues().is_gm()) {
75 if (tissues().get_cgm() >= tissues().get_sgm())
78 }
else if (sgm_depth) {
79 if (seed_in_sgm && !sgm_seed_to_wm) {
80 sgm_seed_to_wm =
true;
91 bool check_seed (
const Eigen::Vector3f& pos)
95 if (!fetch_tissue_data (pos))
98 if (tissues().is_sgm()) {
100 sgm_seed_to_wm =
false;
106 if ((tissues().is_csf()) || !tissues().get_wm() || ((tissues().get_gm() - tissues().get_wm()) >=
GMWMI_ACCURACY))
113 bool seed_is_unidirectional (
const Eigen::Vector3f& pos, Eigen::Vector3f& dir)
116 if (tissues().is_sgm())
return false;
117 if ((tissues().get_wm() >= tissues().get_gm()) || (tissues().get_sgm() >= tissues().get_cgm()))
120 const Tissues tissues_at_pos (tissues());
123 fetch_tissue_data (pos_plus);
124 const Tissues tissues_plus (tissues());
127 fetch_tissue_data (pos_minus);
128 const Tissues& tissues_minus (tissues());
130 const float gradient = (tissues_plus.get_gm() - tissues_plus.get_wm()) - (tissues_minus.get_gm() - tissues_minus.get_wm());
135 tissue_values = tissues_at_pos;
140 bool fetch_tissue_data (
const Eigen::Vector3f& pos)
142 if (!act_image.scanner (pos)) {
143 tissue_values.reset();
146 return tissue_values.set (act_image);
150 bool in_pathology()
const {
return (tissue_values.valid() && tissue_values.is_path()); }
152 void reverse_track() { sgm_depth = 0; }
#define GMWMI_NORMAL_PERTURBATION
Implicit masking for interpolator class.