17#ifndef __dwi_tractography_sift2_tckfactor_h__
18#define __dwi_tractography_sift2_tckfactor_h__
37#define SIFT2_REGULARISATION_TIKHONOV_DEFAULT 0.0
38#define SIFT2_REGULARISATION_TV_DEFAULT 0.1
40#define SIFT2_MIN_TD_FRAC_DEFAULT 0.10
42#define SIFT2_MIN_ITERS_DEFAULT 10
43#define SIFT2_MAX_ITERS_DEFAULT 1000
44#define SIFT2_MIN_COEFF_DEFAULT (-std::numeric_limits<default_type>::infinity())
45#define SIFT2_MAX_COEFF_DEFAULT (std::numeric_limits<default_type>::infinity())
46#define SIFT2_MAX_COEFF_STEP_DEFAULT 1.0
47#define SIFT2_MIN_CF_DECREASE_DEFAULT 2.5e-5
53 namespace Tractography {
66 reg_multiplier_tikhonov (0.0),
67 reg_multiplier_tv (0.0),
74 data_scale_term (0.0) { }
77 void set_reg_lambdas (
const double,
const double);
78 void set_min_iters (
const int i) { min_iters = i; }
79 void set_max_iters (
const int i) { max_iters = i; }
80 void set_min_factor (
const double i) { min_coeff = i ? std::log(i) : -std::numeric_limits<double>::infinity(); }
81 void set_min_coeff (
const double i) { min_coeff = i; }
82 void set_max_factor (
const double i) { max_coeff = std::log(i); }
83 void set_max_coeff (
const double i) { max_coeff = i; }
84 void set_max_coeff_step (
const double i) { max_coeff_step = i; }
85 void set_min_cf_decrease (
const double i) { min_cf_decrease_percentage = i; }
87 void set_csv_path (
const std::string& i) { csv_path = i; }
90 void store_orig_TDs();
96 void test_streamline_length_scaling();
103 void estimate_factors();
105 void output_factors (
const std::string&)
const;
106 void output_coefficients (
const std::string&)
const;
108 void output_all_debug_images (
const std::string&)
const;
112 Eigen::Array<default_type, Eigen::Dynamic, 1> coefficients;
114 double reg_multiplier_tikhonov, reg_multiplier_tv;
115 size_t min_iters, max_iters;
116 double min_coeff, max_coeff, max_coeff_step, min_cf_decrease_percentage;
117 std::string csv_path;
119 double data_scale_term;
134 void indicate_progress() {
if (
App::log_level) fprintf (stderr,
"."); }
const DWI::Directions::FastLookupSet & dirs
void remove_excluded_fixels()
#define SIFT2_MIN_COEFF_DEFAULT
#define SIFT2_MAX_COEFF_DEFAULT
#define SIFT2_MAX_COEFF_STEP_DEFAULT
#define SIFT2_MIN_CF_DECREASE_DEFAULT
#define SIFT2_MAX_ITERS_DEFAULT
#define SIFT2_MIN_ITERS_DEFAULT