17#ifndef __dwi_tractography_sift_sort_h__
18#define __dwi_tractography_sift_sort_h__
33 namespace Tractography
47 grad_per_unit_length (gpul) { }
50 tck_index (that.tck_index),
51 cost_gradient (that.cost_gradient),
52 grad_per_unit_length (that.grad_per_unit_length) { }
54 void set (
const track_t i,
const double g,
const double gpul) { tck_index = i; cost_gradient = g; grad_per_unit_length = gpul; }
56 bool operator< (
const Cost_fn_gradient_sort& that)
const {
return grad_per_unit_length < that.grad_per_unit_length; }
58 track_t get_tck_index()
const {
return tck_index; }
59 double get_cost_gradient()
const {
return cost_gradient; }
60 double get_gradient_per_unit_length()
const {
return grad_per_unit_length; }
65 double grad_per_unit_length;
86 using VecItType = VecType::iterator;
90 bool operator() (
const VecItType& a,
const VecItType& b)
const {
return (a->get_gradient_per_unit_length() < b->get_gradient_per_unit_length()); }
92 using SetType = std::set<VecItType, Comparator>;
102 candidates.insert (in);
103 initial_candidates.insert (in);
109 SetType candidates, initial_candidates;
122 if (counter == num_tracks) {
123 out.first = out.second = 0;
127 counter = std::min (counter + block_size, num_tracks);
128 out.second = counter;
132 const track_t num_tracks, block_size;
141 Sorter (
const Sorter& that) :
MT_gradient_vector_sorter(VecType &in, const track_t)
bool operator()(const VecItType &in)
std::pair< track_t, track_t > TrackIndexRange
Eigen::Matrix< default_type, 3, 1 > VecType