Developer documentation
Version 3.0.3-105-gd3941f44
types.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 __surface_types_h__
18#define __surface_types_h__
19
20
21#include "connectome/connectome.h"
22#include "surface/polygon.h"
23
24
25
26namespace MR
27{
28 namespace Surface
29 {
30
31
32 using Vertex = Eigen::Vector3d;
38
39 class Vox : public Eigen::Array3i
40 { MEMALIGN (Vox)
41 public:
42 using Eigen::Array3i::Array3i;
43 Vox () : Eigen::Array3i (-1, -1, -1) { }
44 Vox (const Eigen::Vector3d& p) : Eigen::Array3i (int(std::round (p[0])), int(std::round (p[1])), int(std::round (p[2]))) { }
45 bool operator< (const Vox& i) const
46 {
47 return ((*this)[2] == i[2] ? (((*this)[1] == i[1]) ? ((*this)[0] < i[0]) : ((*this)[1] < i[1])) : ((*this)[2] < i[2]));
48 }
49 };
50
51 using label_vector_type = Eigen::Array<Connectome::node_t, Eigen::Dynamic, 1>;
52
53
54
55 }
56}
57
58#endif
constexpr I round(const T x)
Definition: math.h:64
Eigen::Array< Connectome::node_t, Eigen::Dynamic, 1 > label_vector_type
Definition: types.h:51
Eigen::Vector3d Vertex
Definition: types.h:32
Definition: base.h:24
#define MEMALIGN(...)
Definition: types.h:185