Developer documentation
Version 3.0.3-105-gd3941f44
track_index_range.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __dwi_tractography_sift_track_index_range_h__
18#define __dwi_tractography_sift_track_index_range_h__
19
20#include "progressbar.h"
22
23namespace MR
24{
25 namespace DWI
26 {
27 namespace Tractography
28 {
29 namespace SIFT
30 {
31
32
33
34#define SIFT_TRACK_INDEX_BUFFER_SIZE 10000
35
36
37
38 using TrackIndexRange = std::pair<track_t, track_t>;
40
41
42
43 // Some processes in SIFT are fast for each streamline, but there are a large number of streamlines, so
44 // if multi-threading is done on a per-track basis the I/O associated with multi-threading begins to dominate
45 // Instead, the input queue for multi-threading is filled with std::pair<track_t, track_t>'s, where the values
46 // are the start and end track indices to be processed
49
50 public:
51 TrackIndexRangeWriter (const track_t, const track_t, const std::string& message = std::string ());
52
53 bool operator() (TrackIndexRange&);
54
55 private:
56 const track_t size, end;
57 track_t start;
58 std::unique_ptr<ProgressBar> progress;
59
60 };
61
62
63
64
65 }
66 }
67 }
68}
69
70
71#endif
72
A first-in first-out thread-safe item queue.
Definition: thread_queue.h:334
unsigned int track_t
Definition: types.h:34
std::pair< track_t, track_t > TrackIndexRange
Definition: base.h:24
#define MEMALIGN(...)
Definition: types.h:185