Developer documentation
Version 3.0.3-105-gd3941f44
scalar.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_scalar_h__
18#define __surface_scalar_h__
19
20
21#include "surface/mesh.h"
22
23
24namespace MR
25{
26 namespace Surface
27 {
28
29
30 class Scalar : public Eigen::Array<default_type, Eigen::Dynamic, 1>
32
33 public:
34 using Base = Eigen::Array<default_type, Eigen::Dynamic, 1>;
35
36 Scalar (const std::string&, const Mesh&);
37
38 Scalar (const Scalar& that) = default;
39
40 Scalar (Scalar&& that) :
41 Base (std::move (that)),
42 name (std::move (that.name)) { }
43
44 Scalar() { }
45
46 Scalar& operator= (Scalar&& that) {
47 Base::operator= (std::move (that));
48 name = std::move (that.name);
49 return *this;
50 }
51
52 Scalar& operator= (const Scalar& that) {
53 Base::operator= (that);
54 name = that.name;
55 return *this;
56 }
57
58
59 void clear() {
60 Base::resize(0);
61 name.clear();
62 }
63
64
65 void save (const std::string&) const;
66
67 const std::string& get_name() const { return name; }
68 void set_name (const std::string& s) { name = s; }
69
70
71 private:
72 std::string name;
73
74 void load_fs_w (const std::string&, const Mesh&);
75 void load_fs_curv (const std::string&, const Mesh&);
76
77 };
78
79
80
81 }
82}
83
84#endif
85
Array & operator=(const MR::Helper::ConstRow< ImageType > &row)
Definition: array.h:25
void resize(const std::string &filename, int64_t size)
Definition: utils.h:187
Definition: base.h:24
#define MEMALIGN(...)
Definition: types.h:185