Developer documentation
Version 3.0.3-105-gd3941f44
vertex_transform.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_filter_vertex_transform_h__
18#define __surface_filter_vertex_transform_h__
19
20#include "header.h"
21#include "transform.h"
22
23#include "surface/mesh.h"
24#include "surface/mesh_multi.h"
25#include "surface/filter/base.h"
26
27
28
29namespace MR
30{
31 namespace Surface
32 {
33 namespace Filter
34 {
35
36
37 class VertexTransform : public Base
39 public:
40 enum class transform_t { UNDEFINED, FIRST2REAL, REAL2FIRST, VOXEL2REAL, REAL2VOXEL, FS2REAL };
41
42 VertexTransform (const Header& H) :
43 header (H),
44 transform (H),
45 mode (transform_t::UNDEFINED) { }
46
47 void set_first2real() { mode = transform_t::FIRST2REAL; }
48 void set_real2first() { mode = transform_t::REAL2FIRST; }
49 void set_voxel2real() { mode = transform_t::VOXEL2REAL; }
50 void set_real2voxel() { mode = transform_t::REAL2VOXEL; }
51 void set_fs2real () { mode = transform_t::FS2REAL ; }
52
53 transform_t get_mode() const { return mode; }
54
55 void operator() (const Mesh&, Mesh&) const override;
56
57 void operator() (const MeshMulti& in, MeshMulti& out) const override {
58 Base::operator() (in, out);
59 }
60
61 private:
62 const Header& header;
63 Transform transform;
64 transform_t mode;
65
66 };
67
68
69 }
70 }
71}
72
73#endif
74
Definition: base.h:24
Eigen::MatrixXd H
#define MEMALIGN(...)
Definition: types.h:185